mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Display forwarded info in video messages.
This commit is contained in:
@@ -290,23 +290,23 @@ void System::showNext() {
|
||||
_waitTimer.start(next - ms);
|
||||
break;
|
||||
} else {
|
||||
HistoryItem *fwd = notifyItem->Has<HistoryMessageForwarded>() ? notifyItem : nullptr; // forwarded notify grouping
|
||||
int32 fwdCount = 1;
|
||||
auto forwardedItem = notifyItem->Has<HistoryMessageForwarded>() ? notifyItem : nullptr; // forwarded notify grouping
|
||||
auto forwardedCount = 1;
|
||||
|
||||
auto ms = getms(true);
|
||||
History *history = notifyItem->history();
|
||||
auto history = notifyItem->history();
|
||||
auto j = _whenMaps.find(history);
|
||||
if (j == _whenMaps.cend()) {
|
||||
history->clearNotifications();
|
||||
} else {
|
||||
HistoryItem *nextNotify = 0;
|
||||
auto nextNotify = (HistoryItem*)nullptr;
|
||||
do {
|
||||
history->skipNotification();
|
||||
if (!history->hasNotification()) {
|
||||
break;
|
||||
}
|
||||
|
||||
j.value().remove((fwd ? fwd : notifyItem)->id);
|
||||
j.value().remove((forwardedItem ? forwardedItem : notifyItem)->id);
|
||||
do {
|
||||
auto k = j.value().constFind(history->currentNotification()->id);
|
||||
if (k != j.value().cend()) {
|
||||
@@ -317,11 +317,11 @@ void System::showNext() {
|
||||
history->skipNotification();
|
||||
} while (history->hasNotification());
|
||||
if (nextNotify) {
|
||||
if (fwd) {
|
||||
HistoryItem *nextFwd = nextNotify->Has<HistoryMessageForwarded>() ? nextNotify : nullptr;
|
||||
if (nextFwd && fwd->author() == nextFwd->author() && qAbs(int64(nextFwd->date.toTime_t()) - int64(fwd->date.toTime_t())) < 2) {
|
||||
fwd = nextFwd;
|
||||
++fwdCount;
|
||||
if (forwardedItem) {
|
||||
auto nextForwarded = nextNotify->Has<HistoryMessageForwarded>() ? nextNotify : nullptr;
|
||||
if (nextForwarded && forwardedItem->author() == nextForwarded->author() && qAbs(int64(nextForwarded->date.toTime_t()) - int64(forwardedItem->date.toTime_t())) < 2) {
|
||||
forwardedItem = nextForwarded;
|
||||
++forwardedCount;
|
||||
} else {
|
||||
nextNotify = nullptr;
|
||||
}
|
||||
@@ -332,7 +332,7 @@ void System::showNext() {
|
||||
} while (nextNotify);
|
||||
}
|
||||
|
||||
_manager->showNotification(notifyItem, fwdCount);
|
||||
_manager->showNotification(notifyItem, forwardedCount);
|
||||
|
||||
if (!history->hasNotification()) {
|
||||
_waiters.remove(history);
|
||||
|
||||
Reference in New Issue
Block a user