summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgroupnotices.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:55:28 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:55:28 +0200
commit201f83472c604e837b40c12f3750602e30d79d0b (patch)
treeb5e983c44eb9913c5778f0773ac986d6bf038e20 /indra/newview/llpanelgroupnotices.cpp
parent696795a368a8825fb083627e39f65dcc30266122 (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' into DRTVWR-543-maint
Diffstat (limited to 'indra/newview/llpanelgroupnotices.cpp')
-rw-r--r--indra/newview/llpanelgroupnotices.cpp38
1 files changed, 15 insertions, 23 deletions
diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp
index c63d04cd55..ab32ea3956 100644
--- a/indra/newview/llpanelgroupnotices.cpp
+++ b/indra/newview/llpanelgroupnotices.cpp
@@ -305,8 +305,11 @@ BOOL LLPanelGroupNotices::postBuild()
void LLPanelGroupNotices::activate()
{
- if(mNoticesList)
- mNoticesList->deleteAllItems();
+ if (mNoticesList)
+ {
+ mNoticesList->deleteAllItems();
+ mKnownNoticeIds.clear();
+ }
mPrevSelectedNotice = LLUUID();
@@ -413,6 +416,7 @@ void LLPanelGroupNotices::onClickSendMessage(void* data)
row["columns"][4]["value"] = llformat( "%u", timestamp);
self->mNoticesList->addElement(row, ADD_BOTTOM);
+ self->mKnownNoticeIds.insert(id);
self->mCreateMessage->clear();
self->mCreateSubject->clear();
@@ -443,27 +447,13 @@ void LLPanelGroupNotices::onClickNewMessage(void* data)
void LLPanelGroupNotices::refreshNotices()
{
onClickRefreshNotices(this);
- /*
- LL_DEBUGS() << "LLPanelGroupNotices::onClickGetPastNotices" << LL_ENDL;
-
- mNoticesList->deleteAllItems();
-
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessage("GroupNoticesListRequest");
- msg->nextBlock("AgentData");
- msg->addUUID("AgentID",gAgent.getID());
- msg->addUUID("SessionID",gAgent.getSessionID());
- msg->nextBlock("Data");
- msg->addUUID("GroupID",self->mGroupID);
- gAgent.sendReliableMessage();
- */
-
}
void LLPanelGroupNotices::clearNoticeList()
{
mPrevSelectedNotice = mNoticesList->getStringUUIDSelectedItem();
mNoticesList->deleteAllItems();
+ mKnownNoticeIds.clear();
}
void LLPanelGroupNotices::onClickRefreshNotices(void* data)
@@ -541,13 +531,14 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
return;
}
- //with some network delays we can receive notice list more then once...
- //so add only unique notices
- S32 pos = mNoticesList->getItemIndex(id);
+ // Due to some network delays we can receive notice list more than once...
+ // So add only unique notices
+ if (mKnownNoticeIds.find(id) != mKnownNoticeIds.end())
+ {
+ // If items with this ID already in the list - skip it
+ continue;
+ }
- 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);
msg->getBOOL("Data","HasAttachment",has_attachment,i);
@@ -582,6 +573,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
row["columns"][4]["value"] = llformat( "%u", timestamp);
mNoticesList->addElement(row, ADD_BOTTOM);
+ mKnownNoticeIds.insert(id);
}
mNoticesList->setNeedsSort(save_sort);