projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
properly handling message lists where no message survived dupe checks
[quassel.git]
/
src
/
client
/
messagemodel.cpp
diff --git
a/src/client/messagemodel.cpp
b/src/client/messagemodel.cpp
index
868082c
..
818c254
100644
(file)
--- a/
src/client/messagemodel.cpp
+++ b/
src/client/messagemodel.cpp
@@
-218,6
+218,11
@@
int MessageModel::insertMessagesGracefully(const QList<Message> &msglist) {
break;
processedMsgs++;
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();
if((*iter).msgId() != dupeId) {
if(!grouplist.isEmpty()) {
QDateTime nextTs = grouplist.value(0).timestamp();
@@
-244,6
+249,11
@@
int MessageModel::insertMessagesGracefully(const QList<Message> &msglist) {
break;
processedMsgs++;
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();
if((*iter).msgId() != dupeId) {
if(!grouplist.isEmpty()) {
QDateTime nextTs = grouplist.value(0).timestamp();
@@
-267,8
+277,8
@@
int MessageModel::insertMessagesGracefully(const QList<Message> &msglist) {
}
}
}
}
- Q_ASSERT(idx == indexForId(grouplist.first().msgId()) && idx == indexForId(grouplist.last().msgId()));
- insertMessageGroup(grouplist);
+ if(!grouplist.isEmpty())
+
insertMessageGroup(grouplist);
return processedMsgs;
}
return processedMsgs;
}