I need less unstaged code
Here's pieces of the WIP offline->IM->online fix
This commit is contained in:
@@ -295,6 +295,7 @@ public:
|
|||||||
llwchar getWChar(S32 pos) const { return mWText[pos]; }
|
llwchar getWChar(S32 pos) const { return mWText[pos]; }
|
||||||
LLWString getWSubString(S32 pos, S32 len) const { return mWText.substr(pos, len); }
|
LLWString getWSubString(S32 pos, S32 len) const { return mWText.substr(pos, len); }
|
||||||
|
|
||||||
|
const LLTextSegment* getLastSegment() const { return mSegments.empty() ? nullptr : mSegments.back(); }
|
||||||
const LLTextSegment* getCurrentSegment() const { return getSegmentAtOffset(mCursorPos); }
|
const LLTextSegment* getCurrentSegment() const { return getSegmentAtOffset(mCursorPos); }
|
||||||
const LLTextSegment* getPreviousSegment() const;
|
const LLTextSegment* getPreviousSegment() const;
|
||||||
void getSelectedSegments(std::vector<LLTextSegmentPtr>& segments) const;
|
void getSelectedSegments(std::vector<LLTextSegmentPtr>& segments) const;
|
||||||
|
|||||||
@@ -1227,7 +1227,7 @@ void deliver_message(const std::string& utf8_text,
|
|||||||
if((offline == IM_OFFLINE) && (LLVoiceClient::getInstance()->isOnlineSIP(other_participant_id)))
|
if((offline == IM_OFFLINE) && (LLVoiceClient::getInstance()->isOnlineSIP(other_participant_id)))
|
||||||
{
|
{
|
||||||
// User is online through the OOW connector, but not with a regular viewer. Try to send the message via SLVoice.
|
// User is online through the OOW connector, but not with a regular viewer. Try to send the message via SLVoice.
|
||||||
sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text);
|
// sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!sent)
|
if(!sent)
|
||||||
|
|||||||
@@ -1097,31 +1097,39 @@ bool LLIMMgr::isNonFriendSessionNotified(const LLUUID& session_id)
|
|||||||
return mNotifiedNonFriendSessions.end() != mNotifiedNonFriendSessions.find(session_id);
|
return mNotifiedNonFriendSessions.end() != mNotifiedNonFriendSessions.find(session_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string LLIMMgr::getOfflineMessage(const LLUUID& id)
|
||||||
|
{
|
||||||
|
std::string full_name;
|
||||||
|
if (LLAvatarNameCache::getNSName(id, full_name))
|
||||||
|
{
|
||||||
|
LLUIString offline = LLTrans::getString("offline_message");
|
||||||
|
offline.setArg("[NAME]", full_name);
|
||||||
|
return offline;
|
||||||
|
}
|
||||||
|
return LLStringUtil::null;
|
||||||
|
}
|
||||||
|
|
||||||
void LLIMMgr::noteOfflineUsers(
|
void LLIMMgr::noteOfflineUsers(
|
||||||
LLFloaterIMPanel* floater,
|
LLFloaterIMPanel* floater,
|
||||||
const std::vector<LLUUID>& ids)
|
const std::vector<LLUUID>& ids)
|
||||||
{
|
{
|
||||||
S32 count = ids.size();
|
if(ids.empty())
|
||||||
if(count == 0)
|
|
||||||
{
|
{
|
||||||
const std::string& only_user = LLTrans::getString("only_user_message");
|
const std::string& only_user = LLTrans::getString("only_user_message");
|
||||||
floater->addHistoryLine(only_user, gSavedSettings.getColor4("SystemChatColor"));
|
floater->addHistoryLine(only_user, gSavedSettings.getColor4("SystemChatColor"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const LLRelationship* info = NULL;
|
const LLRelationship* info = nullptr;
|
||||||
LLAvatarTracker& at = LLAvatarTracker::instance();
|
LLAvatarTracker& at = LLAvatarTracker::instance();
|
||||||
for(S32 i = 0; i < count; ++i)
|
for(const auto& id : ids)
|
||||||
{
|
{
|
||||||
info = at.getBuddyInfo(ids.at(i));
|
info = at.getBuddyInfo(id);
|
||||||
std::string full_name;
|
if (info && !info->isOnline())
|
||||||
if (info
|
|
||||||
&& !info->isOnline()
|
|
||||||
&& LLAvatarNameCache::getNSName(ids.at(i), full_name))
|
|
||||||
{
|
{
|
||||||
LLUIString offline = LLTrans::getString("offline_message");
|
auto offline(getOfflineMessage(id));
|
||||||
offline.setArg("[NAME]", full_name);
|
if (!offline.empty())
|
||||||
floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor"));
|
floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,8 @@ public:
|
|||||||
|
|
||||||
bool isNonFriendSessionNotified(const LLUUID& session_id);
|
bool isNonFriendSessionNotified(const LLUUID& session_id);
|
||||||
|
|
||||||
|
static std::string getOfflineMessage(const LLUUID& id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// create a panel and update internal representation for
|
// create a panel and update internal representation for
|
||||||
// consistency. Returns the pointer, caller (the class instance
|
// consistency. Returns the pointer, caller (the class instance
|
||||||
|
|||||||
Reference in New Issue
Block a user