Add unpinned message admin log event action.

This commit is contained in:
John Preston 2017-06-28 18:22:56 +03:00
parent 58b4798b79
commit 91dcfff423
2 changed files with 11 additions and 5 deletions

View File

@ -1347,6 +1347,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_admin_log_signatures_enabled" = "{from} enabled signatures";
"lng_admin_log_signatures_disabled" = "{from} disabled signatures";
"lng_admin_log_pinned_message" = "{from} pinned message:";
"lng_admin_log_unpinned_message" = "{from} unpinned message";
"lng_admin_log_edited_caption" = "{from} edited caption:";
"lng_admin_log_removed_caption" = "{from} removed caption";
"lng_admin_log_previous_caption" = "Original caption";

View File

@ -327,12 +327,17 @@ void GenerateItems(gsl::not_null<History*> history, LocalIdManager &idManager, c
};
auto createUpdatePinned = [&](const MTPDchannelAdminLogEventActionUpdatePinned &action) {
auto text = lng_admin_log_pinned_message(lt_from, fromLinkText);
addSimpleServiceMessage(text);
if (action.vmessage.type() == mtpc_messageEmpty) {
auto text = lng_admin_log_unpinned_message(lt_from, fromLinkText);
addSimpleServiceMessage(text);
} else {
auto text = lng_admin_log_pinned_message(lt_from, fromLinkText);
addSimpleServiceMessage(text);
auto applyServiceAction = false;
auto detachExistingItem = false;
addPart(history->createItem(PrepareLogMessage(action.vmessage, idManager.next(), date.v), applyServiceAction, detachExistingItem));
auto applyServiceAction = false;
auto detachExistingItem = false;
addPart(history->createItem(PrepareLogMessage(action.vmessage, idManager.next(), date.v), applyServiceAction, detachExistingItem));
}
};
auto createEditMessage = [&](const MTPDchannelAdminLogEventActionEditMessage &action) {