mirror of https://github.com/procxx/kepka.git
				
				
				
			Workaround for a server-side bug with dates of migrate/invite.
Fixes the appearing of duplicated supergroup migrate message together with not needed client side joined/invited message.
This commit is contained in:
		
							parent
							
								
									8e0bab5adc
								
							
						
					
					
						commit
						fccae52654
					
				|  | @ -398,12 +398,14 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { | |||
| 			HistoryItem *item = block->items.at(--itemIndex); | ||||
| 			HistoryItemType type = item->type(); | ||||
| 			if (type == HistoryItemMsg) { | ||||
| 				if (item->date <= inviteDate) { | ||||
| 					if (peer->isMegagroup() && peer->migrateFrom() && item->isGroupMigrate()) { | ||||
| 				// Due to a server bug sometimes inviteDate is less (before) than the
 | ||||
| 				// first message in the megagroup (message about migration), let us
 | ||||
| 				// ignore that and think, that the inviteDate is always greater-or-equal.
 | ||||
| 				if (item->isGroupMigrate() && peer->isMegagroup() && peer->migrateFrom()) { | ||||
| 					peer->asChannel()->mgInfo->joinedMessageFound = true; | ||||
| 					return nullptr; | ||||
| 				} | ||||
| 
 | ||||
| 				if (item->date <= inviteDate) { | ||||
| 					++itemIndex; | ||||
| 					_joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); | ||||
| 					addNewInTheMiddle(_joinedMessage, blockIndex, itemIndex); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue