2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

supergroups done

This commit is contained in:
John Preston
2015-11-20 21:24:44 +03:00
parent ecc49f9cd4
commit b05e1a8899
15 changed files with 146 additions and 46 deletions

View File

@@ -510,10 +510,11 @@ namespace App {
channel->inputChannel = d.vmigrated_to;
channel->access = d.vmigrated_to.c_inputChannel().vaccess_hash.v;
}
if (cdata->migrateToPtr != channel) {
bool updatedTo = (cdata->migrateToPtr != channel), updatedFrom = (channel->mgInfo->migrateFromPtr != cdata);
if (updatedTo) {
cdata->migrateToPtr = channel;
}
if (channel->mgInfo->migrateFromPtr != cdata) {
if (updatedFrom) {
channel->mgInfo->migrateFromPtr = cdata;
if (History *h = App::historyLoaded(cdata->id)) {
if (History *hto = App::historyLoaded(channel->id)) {
@@ -525,6 +526,10 @@ namespace App {
}
}
}
Notify::migrateUpdated(channel);
}
if (updatedTo) {
Notify::migrateUpdated(cdata);
}
}
@@ -1044,8 +1049,13 @@ namespace App {
}
(*j)->destroy();
if (!h->lastMsg) historiesToCheck.insert(h, true);
} else if (channelHistory) {
channelHistory->messageWithIdDeleted(i->v);
} else {
if (channelHistory) {
channelHistory->messageWithIdDeleted(i->v);
if (channelHistory->unreadCount > 0 && i->v >= channelHistory->inboxReadBefore) {
channelHistory->setUnreadCount(channelHistory->unreadCount - 1);
}
}
}
}
if (resized) {
@@ -2862,4 +2872,10 @@ namespace Notify {
}
}
void migrateUpdated(PeerData *peer) {
if (MainWidget *m = App::main()) {
m->notifyMigrateUpdated(peer);
}
}
}