Fixed join group messages

Closes #1091
This commit is contained in:
Igor Zhukov 2016-04-03 23:23:48 +03:00
parent 392c99d554
commit 5b049aff59
5 changed files with 14 additions and 2 deletions

View File

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

View File

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

View File

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

View File

@ -8,6 +8,7 @@
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="message_service_removed_group_photo"></span> <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="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="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"> <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> <my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span> </span>

View File

@ -8,6 +8,7 @@
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="message_service_removed_group_photo"></span> <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="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="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"> <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> <my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span> </span>