summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgroupnotices.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:56:33 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:56:33 +0200
commitf62579f29303b33ff331f3f0b0e8d4197755d279 (patch)
tree06744ee5ccb2280970c8eed3303db326fbd5c128 /indra/newview/llpanelgroupnotices.cpp
parent611869b1035ef5677335a33169fb99413a90c3a6 (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' into DRTVWR-548-maint-N
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);