mirror of
https://github.com/vale981/tdesktop
synced 2025-03-05 17:51:41 -05:00
Show invite link owner in service message.
This commit is contained in:
parent
e781b29d57
commit
27103889a4
2 changed files with 8 additions and 6 deletions
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue