X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fmessagemodel.cpp;h=09d8ddc87fb35daa2ccf20c97f4291a14074a26f;hp=868082cea12e5af4157546c7bc48e0ee531af26b;hb=722557f44cb857b9467b84c87f742dce8e98a500;hpb=b433321cc124a1a34f5f7f53acc699f5afd1ba04 diff --git a/src/client/messagemodel.cpp b/src/client/messagemodel.cpp index 868082ce..09d8ddc8 100644 --- a/src/client/messagemodel.cpp +++ b/src/client/messagemodel.cpp @@ -218,6 +218,11 @@ int MessageModel::insertMessagesGracefully(const QList &msglist) { break; processedMsgs++; + if(grouplist.isEmpty()) { // as long as we don't have a starting point, we have to update the dupeId + idx = indexForId((*iter).msgId()); + if(idx >= 0 && !_messageList.isEmpty()) + dupeId = _messageList[idx]->msgId(); + } if((*iter).msgId() != dupeId) { if(!grouplist.isEmpty()) { QDateTime nextTs = grouplist.value(0).timestamp(); @@ -244,6 +249,11 @@ int MessageModel::insertMessagesGracefully(const QList &msglist) { break; processedMsgs++; + if(grouplist.isEmpty()) { // as long as we don't have a starting point, we have to update the dupeId + idx = indexForId((*iter).msgId()); + if(idx >= 0 && !_messageList.isEmpty()) + dupeId = _messageList[idx]->msgId(); + } if((*iter).msgId() != dupeId) { if(!grouplist.isEmpty()) { QDateTime nextTs = grouplist.value(0).timestamp(); @@ -267,7 +277,6 @@ int MessageModel::insertMessagesGracefully(const QList &msglist) { } } - Q_ASSERT(idx == indexForId(grouplist.first().msgId()) && idx == indexForId(grouplist.last().msgId())); insertMessageGroup(grouplist); return processedMsgs; }