Fix a potential bug in LLSpeakerMgr wherein speakers would not be added to group chat participant lists in LOTE
Also clean up (static) translated constants for group_member_statuses
This commit is contained in:
@@ -964,6 +964,17 @@ static void formatDateString(std::string &date_string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string& localized_online()
|
||||||
|
{
|
||||||
|
static const std::string online(LLTrans::getString("group_member_status_online"));
|
||||||
|
return online;
|
||||||
|
}
|
||||||
|
const std::string& localized_unknown()
|
||||||
|
{
|
||||||
|
static const std::string unknown(LLTrans::getString("group_member_status_unknown"));
|
||||||
|
return unknown;
|
||||||
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
|
void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
|
||||||
{
|
{
|
||||||
@@ -1015,13 +1026,11 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
|
|||||||
{
|
{
|
||||||
if (online_status == "Online")
|
if (online_status == "Online")
|
||||||
{
|
{
|
||||||
static std::string localized_online(LLTrans::getString("group_member_status_online"));
|
online_status = localized_online();
|
||||||
online_status = localized_online;
|
|
||||||
}
|
}
|
||||||
else if (online_status == "unknown")
|
else if (online_status == "unknown")
|
||||||
{
|
{
|
||||||
static std::string localized_unknown(LLTrans::getString("group_member_status_unknown"));
|
online_status = localized_unknown();
|
||||||
online_status = localized_unknown;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2214,7 +2223,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
|
|||||||
for ( ; member_iter_start != member_iter_end; ++member_iter_start)
|
for ( ; member_iter_start != member_iter_end; ++member_iter_start)
|
||||||
{
|
{
|
||||||
// Reset defaults
|
// Reset defaults
|
||||||
online_status = LLTrans::getString("group_member_status_unknown");
|
online_status = localized_unknown();
|
||||||
title = titles[0].asString();
|
title = titles[0].asString();
|
||||||
contribution = 0;
|
contribution = 0;
|
||||||
member_powers = default_powers;
|
member_powers = default_powers;
|
||||||
@@ -2227,9 +2236,9 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
|
|||||||
{
|
{
|
||||||
online_status = member_info["last_login"].asString();
|
online_status = member_info["last_login"].asString();
|
||||||
if (online_status == "Online")
|
if (online_status == "Online")
|
||||||
online_status = LLTrans::getString("group_member_status_online");
|
online_status = localized_online();
|
||||||
else if (online_status == "unknown")
|
else if (online_status == "unknown")
|
||||||
online_status = LLTrans::getString("group_member_status_unknown");
|
online_status = localized_unknown();
|
||||||
else
|
else
|
||||||
formatDateString(online_status);
|
formatDateString(online_status);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,6 @@
|
|||||||
#include "lltabcontainer.h"
|
#include "lltabcontainer.h"
|
||||||
#include "lltextbox.h"
|
#include "lltextbox.h"
|
||||||
#include "lltexteditor.h"
|
#include "lltexteditor.h"
|
||||||
#include "lltrans.h"
|
|
||||||
#include "llviewertexturelist.h"
|
#include "llviewertexturelist.h"
|
||||||
#include "llviewerwindow.h"
|
#include "llviewerwindow.h"
|
||||||
#include "llfocusmgr.h"
|
#include "llfocusmgr.h"
|
||||||
@@ -1670,10 +1669,9 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc)
|
|||||||
|
|
||||||
bool is_online_status_string(const std::string& status)
|
bool is_online_status_string(const std::string& status)
|
||||||
{
|
{
|
||||||
static const std::string online(LLTrans::getString("group_member_status_online"));
|
const std::string& localized_online();
|
||||||
if (status == online) return true;
|
const std::string& localized_unknown();
|
||||||
static const std::string unknown(LLTrans::getString("group_member_status_unknown"));
|
return status == localized_online() || status == localized_unknown();
|
||||||
return status == unknown;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data)
|
void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data)
|
||||||
|
|||||||
@@ -580,7 +580,8 @@ void LLSpeakerMgr::updateSpeakerList()
|
|||||||
LLGroupMemberData* member = member_it->second;
|
LLGroupMemberData* member = member_it->second;
|
||||||
LLUUID id = member_it->first;
|
LLUUID id = member_it->first;
|
||||||
// Add only members who are online and not already in the list
|
// Add only members who are online and not already in the list
|
||||||
if ((member->getOnlineStatus() == "Online") && (mSpeakers.find(id) == mSpeakers.end()))
|
const std::string& localized_online();
|
||||||
|
if ((member->getOnlineStatus() == localized_online()) && (mSpeakers.find(id) == mSpeakers.end()))
|
||||||
{
|
{
|
||||||
LLPointer<LLSpeaker> speakerp = setSpeaker(id, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
|
LLPointer<LLSpeaker> speakerp = setSpeaker(id, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
|
||||||
speakerp->mIsModerator = ((member->getAgentPowers() & GP_SESSION_MODERATOR) == GP_SESSION_MODERATOR);
|
speakerp->mIsModerator = ((member->getAgentPowers() & GP_SESSION_MODERATOR) == GP_SESSION_MODERATOR);
|
||||||
|
|||||||
Reference in New Issue
Block a user