diff options
Diffstat (limited to 'protocols/Telegram/src/server.cpp')
-rw-r--r-- | protocols/Telegram/src/server.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 762d6d121a..96d941089b 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -776,6 +776,31 @@ void CTelegramProto::ProcessMessage(const TD::message *pMessage) return;
}
+ if (auto *pForward = pMessage->forward_info_.get()) {
+ CMStringW wszNick;
+ switch (pForward->origin_->get_id()) {
+ case TD::messageForwardOriginUser::ID:
+ if (auto *p = FindUser(((TD::messageForwardOriginUser *)pForward->origin_.get())->sender_user_id_))
+ wszNick = p->getDisplayName();
+ break;
+ case TD::messageForwardOriginChat::ID:
+ if (auto *p = FindChat(((TD::messageForwardOriginChat *)pForward->origin_.get())->sender_chat_id_))
+ wszNick = p->getDisplayName();
+ break;
+ case TD::messageForwardOriginChannel::ID:
+ if (auto *p = FindChat(((TD::messageForwardOriginChannel *)pForward->origin_.get())->chat_id_))
+ wszNick = p->getDisplayName();
+ break;
+ default:
+ wszNick = TranslateT("Unknown");
+ }
+
+ wchar_t wszDate[100];
+ TimeZone_PrintTimeStamp(0, pForward->date_, L"d t", wszDate, _countof(wszDate), 0);
+ CMStringW wszForward(FORMAT, L">%s %s %s\r\n", wszDate, wszNick.c_str(), TranslateT("wrote"));
+ szText.Insert(0, T2Utf(wszForward));
+ }
+
// make a temporary contact if needed
if (pUser->hContact == INVALID_CONTACT_ID) {
if (pUser->isGroupChat) {
|