Browse Source

Fixed join group messages

Closes #1091
master
Igor Zhukov 8 years ago
parent
commit
5b049aff59
  1. 4
      app/js/locales/en-us.json
  2. 9
      app/js/messages_manager.js
  3. 1
      app/partials/desktop/dialog_service.html
  4. 1
      app/partials/desktop/message_service.html
  5. 1
      app/partials/mobile/message_service.html

4
app/js/locales/en-us.json

@ -295,13 +295,14 @@ @@ -295,13 +295,14 @@
"conversation_group_photo_updated": "changed group photo",
"conversation_group_photo_removed": "removed group photo",
"conversation_returned_to_group": "returned to group",
"conversation_joined_group": "joined the group",
"conversation_invited_user": "invited {user}",
"conversation_invited_users": "{'one': 'invited {} user', 'other': 'invited {} users'}",
"conversation_left_group": "left group",
"conversation_kicked_user": "removed {user}",
"conversation_invited_user_message": "invited user",
"conversation_kicked_user_message": "removed user",
"conversation_joined_by_link": "joined group",
"conversation_joined_by_link": "joined the group",
"conversation_converted_to_supergroup": "upgraded to a supergroup",
"conversation_created_channel": "Channel created",
"conversation_changed_channel_name": "Channel renamed",
@ -324,6 +325,7 @@ @@ -324,6 +325,7 @@
"message_service_kicked_user": "removed {user}",
"message_service_left_group": "left group",
"message_service_joined_by_link": "joined group via invite link",
"message_service_joined": "joined the group",
"message_service_unsupported_action": "unsupported action {action}",
"message_service_bot_intro_header": "What can this bot do?",
"message_service_converted_to_supergroup": "upgraded the group to a supergroup",

9
app/js/messages_manager.js

@ -1239,7 +1239,11 @@ angular.module('myApp.services') @@ -1239,7 +1239,11 @@ angular.module('myApp.services')
if (apiMessage.action.users.length == 1) {
apiMessage.action.user_id = apiMessage.action.users[0];
if (apiMessage.fromID == apiMessage.action.user_id) {
apiMessage.action._ = 'messageActionChatReturn';
if (isChannel) {
apiMessage.action._ = 'messageActionChatJoined';
} else {
apiMessage.action._ = 'messageActionChatReturn';
}
}
}
else if (apiMessage.action.users.length > 1) {
@ -2517,6 +2521,9 @@ angular.module('myApp.services') @@ -2517,6 +2521,9 @@ angular.module('myApp.services')
case 'messageActionChatReturn':
notificationMessage = _('conversation_returned_to_group_raw');
break;
case 'messageActionChatJoined':
notificationMessage = _('conversation_joined_group_raw');
break;
case 'messageActionChatDeleteUser':
notificationMessage = _('conversation_kicked_user_message_raw');
break;

1
app/partials/desktop/dialog_service.html

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="conversation_group_photo_removed"></span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="conversation_joined_by_link"></span>
<span ng-switch-when="messageActionChatReturn" my-i18n="conversation_returned_to_group"></span>
<span ng-switch-when="messageActionChatJoined" my-i18n="conversation_joined_group"></span>
<span ng-switch-when="messageActionChatAddUser" my-i18n="conversation_invited_user">
<my-i18n-param name="user"><span my-peer-link="message.action.user_id"></span></my-i18n-param>
</span>

1
app/partials/desktop/message_service.html

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="message_service_removed_group_photo"></span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="message_service_joined_by_link"></span>
<span ng-switch-when="messageActionChatReturn" my-i18n="message_service_returned_to_group"></span>
<span ng-switch-when="messageActionChatJoined" my-i18n="message_service_joined"></span>
<span ng-switch-when="messageActionChatAddUser" my-i18n="message_service_invited_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>

1
app/partials/mobile/message_service.html

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="message_service_removed_group_photo"></span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="message_service_joined_by_link"></span>
<span ng-switch-when="messageActionChatReturn" my-i18n="message_service_returned_to_group"></span>
<span ng-switch-when="messageActionChatJoined" my-i18n="message_service_joined"></span>
<span ng-switch-when="messageActionChatAddUser" my-i18n="message_service_invited_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>

Loading…
Cancel
Save