summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2010-04-26 18:58:48 +0300
committerYuri Chebotarev <ychebotarev@productengine.com>2010-04-26 18:58:48 +0300
commit24894a5f71b76aab407976ff9bf36bfc0f7ae70a (patch)
tree69474fbf396ce2fef8ba78aa021db413960f5e24 /indra
parentd0204a2b149462371ee20725067e43b018c485bb (diff)
EXT-6969 Group notices can appear duplicated in group profile
reviewed Mike Antipov https://codereview.productengine.com/secondlife/r/308/ --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelgroupnotices.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp
index f7d76bc069..230e484fad 100644
--- a/indra/newview/llpanelgroupnotices.cpp
+++ b/indra/newview/llpanelgroupnotices.cpp
@@ -517,6 +517,11 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
mNoticesList->setEnabled(TRUE);
+ //save sort state and set unsorted state to prevent unnecessary
+ //sorting while adding notices
+ bool save_sort = mNoticesList->isSorted();
+ mNoticesList->setNeedsSort(false);
+
for (;i<count;++i)
{
msg->getUUID("Data","NoticeID",id,i);
@@ -527,6 +532,13 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
mNoticesList->setEnabled(FALSE);
return;
}
+
+ //with some network delays we can receive notice list more then once...
+ //so add only unique notices
+ S32 pos = mNoticesList->getItemIndex(id);
+
+ if(pos!=-1)//if items with this ID already in the list - skip it
+ continue;
msg->getString("Data","Subject",subj,i);
msg->getString("Data","FromName",name,i);
@@ -562,6 +574,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
mNoticesList->addElement(row, ADD_BOTTOM);
}
+ mNoticesList->setNeedsSort(save_sort);
mNoticesList->updateSort();
}