2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Choose a channel to send messages as.

This commit is contained in:
John Preston
2021-11-09 17:50:33 +04:00
parent 4691cff3f6
commit 1bd74fe478
7 changed files with 319 additions and 23 deletions

View File

@@ -17,6 +17,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_location.h"
#include "data/data_histories.h"
#include "data/data_group_call.h"
#include "main/main_session.h"
#include "main/session/send_as_peers.h"
#include "base/unixtime.h"
#include "history/history.h"
#include "main/main_session.h"
@@ -915,6 +917,12 @@ void ApplyChannelUpdate(
MTP_inputNotifyPeer(channel->input),
update.vnotify_settings());
if (const auto sendAs = update.vdefault_send_as()) {
session->sendAsPeers().setChosen(channel, peerFromMTP(*sendAs));
} else {
session->sendAsPeers().setChosen(channel, PeerId());
}
// For clearUpTill() call.
channel->owner().sendHistoryChangeNotifications();
}