2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

fixed crash in showNextNotify, started reportspam button

This commit is contained in:
John Preston
2015-09-07 18:53:46 +03:00
parent 42d297f192
commit c45d9e9860
12 changed files with 123 additions and 8 deletions

View File

@@ -566,10 +566,17 @@ namespace App {
int32 pversion = chat->participants.isEmpty() ? 1 : (chat->participants.begin().value() + 1);
chat->cankick = ChatData::CanKick();
for (QVector<MTPChatParticipant>::const_iterator i = v.cbegin(), e = v.cend(); i != e; ++i) {
UserData *user = App::userLoaded(i->c_chatParticipant().vuser_id.v);
if (i->type() != mtpc_chatParticipant) continue;
const MTPDchatParticipant &p(i->c_chatParticipant());
//if (p.vuser_id.v == MTP::authedId()) {
// chat->inviter = p.vinviter_id.v; // we use inviter only from service msgs
// chat->inviteDate = p.vdate.v;
//}
UserData *user = App::userLoaded(p.vuser_id.v);
if (user) {
chat->participants[user] = pversion;
if (i->c_chatParticipant().vinviter_id.v == MTP::authedId()) {
if (p.vinviter_id.v == MTP::authedId()) {
chat->cankick[user] = true;
}
} else {
@@ -619,6 +626,10 @@ namespace App {
ChatData *chat = App::chat(d.vchat_id.v);
if (chat->version <= d.vversion.v && chat->count >= 0) {
chat->version = d.vversion.v;
//if (d.vuser_id.v == MTP::authedId()) {
// chat->inviter = d.vinviter_id.v; // we use inviter only from service msgs
// chat->inviteDate = unixtime(); // no event date here :(
//}
UserData *user = App::userLoaded(d.vuser_id.v);
if (user) {
if (chat->participants.isEmpty() && chat->count) {