diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 25d8914997..f667b5070b 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -846,7 +846,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_action_kick_user" = "{from} removed {user}"; "lng_action_user_left" = "{from} left the group"; "lng_action_user_joined" = "{from} joined the group"; -"lng_action_user_joined_by_link" = "{from} joined the group via invite link"; +"lng_action_user_joined_by_link_from" = "{from} joined the group via invite link from {user}"; "lng_action_user_registered" = "{from} just joined Telegram"; "lng_action_removed_photo" = "{from} removed group photo"; "lng_action_removed_photo_channel" = "Channel photo removed"; diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp index 6918757237..11dfe86075 100644 --- a/Telegram/SourceFiles/history/history_service.cpp +++ b/Telegram/SourceFiles/history/history_service.cpp @@ -36,14 +36,14 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) { auto result = PreparedText {}; auto &users = action.vusers.v; if (users.size() == 1) { - auto u = App::user(peerFromUser(users[0])); - if (u == _from) { + auto user = App::user(peerFromUser(users[0])); + if (user == _from) { result.links.push_back(fromLink()); result.text = lng_action_user_joined(lt_from, fromLinkText()); } else { result.links.push_back(fromLink()); - result.links.push_back(u->createOpenLink()); - result.text = lng_action_add_user(lt_from, fromLinkText(), lt_user, textcmdLink(2, u->name)); + result.links.push_back(user->createOpenLink()); + result.text = lng_action_add_user(lt_from, fromLinkText(), lt_user, textcmdLink(2, user->name)); } } else if (users.isEmpty()) { result.links.push_back(fromLink()); @@ -69,9 +69,11 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) { }; auto prepareChatJoinedByLink = [this](const MTPDmessageActionChatJoinedByLink &action) { + const auto user = App::user(peerFromUser(action.vinviter_id.v)); auto result = PreparedText {}; result.links.push_back(fromLink()); - result.text = lng_action_user_joined_by_link(lt_from, fromLinkText()); + result.links.push_back(user->createOpenLink()); + result.text = lng_action_user_joined_by_link_from(lt_from, fromLinkText(), lt_user, textcmdLink(2, user->name)); return result; };