mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-05 00:55:12 +00:00
Some internal HistoryItem refactoring.
Replace most IsServerMsgId / id <=> 0 with isRegular(). Track isLocal / isHistoryEntry in flags. Remove toHistoryMessage.
This commit is contained in:
@@ -100,7 +100,7 @@ void Histories::readInbox(not_null<History*> history) {
|
||||
|
||||
void Histories::readInboxTill(not_null<HistoryItem*> item) {
|
||||
const auto history = item->history();
|
||||
if (!IsServerMsgId(item->id)) {
|
||||
if (!item->isRegular()) {
|
||||
readClientSideMessage(item);
|
||||
auto view = item->mainView();
|
||||
if (!view) {
|
||||
@@ -123,11 +123,11 @@ void Histories::readInboxTill(not_null<HistoryItem*> item) {
|
||||
}
|
||||
}
|
||||
item = view->data();
|
||||
if (IsServerMsgId(item->id)) {
|
||||
if (item->isRegular()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!IsServerMsgId(item->id)) {
|
||||
if (!item->isRegular()) {
|
||||
LOG(("App Error: "
|
||||
"Can't read history till unknown local message."));
|
||||
return;
|
||||
@@ -235,7 +235,7 @@ void Histories::readInboxTill(
|
||||
}
|
||||
|
||||
void Histories::readInboxOnNewMessage(not_null<HistoryItem*> item) {
|
||||
if (!IsServerMsgId(item->id)) {
|
||||
if (!item->isRegular()) {
|
||||
readClientSideMessage(item);
|
||||
} else {
|
||||
readInboxTill(item->history(), item->id, true);
|
||||
@@ -728,7 +728,7 @@ void Histories::deleteMessages(const MessageIdsList &ids, bool revoke) {
|
||||
continue;
|
||||
}
|
||||
remove.push_back(item);
|
||||
if (IsServerMsgId(item->id)) {
|
||||
if (item->isRegular()) {
|
||||
idsByPeer[history].push_back(MTP_int(itemId.msg));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user