aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llimpanel.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-09-13 11:57:42 -0700
committerMcCabe Maxsted2010-09-13 14:27:25 -0700
commiteb8a075b070d2e718c5bb9113490ca0b7626592e (patch)
treeccbcb23cef8855f90622b6629beb81f4d0f1b04e /linden/indra/newview/llimpanel.cpp
parentUpdated German translation, part 2, by Eryn Galen (diff)
downloadmeta-impy-eb8a075b070d2e718c5bb9113490ca0b7626592e.zip
meta-impy-eb8a075b070d2e718c5bb9113490ca0b7626592e.tar.gz
meta-impy-eb8a075b070d2e718c5bb9113490ca0b7626592e.tar.bz2
meta-impy-eb8a075b070d2e718c5bb9113490ca0b7626592e.tar.xz
Added the 'Add Friend' option to IMs and fixed the Group Profile button showing the wrong profile (#514)
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llimpanel.cpp52
1 files changed, 37 insertions, 15 deletions
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp
index 6cf7ffb..797e997 100644
--- a/linden/indra/newview/llimpanel.cpp
+++ b/linden/indra/newview/llimpanel.cpp
@@ -59,6 +59,7 @@
59#include "llfloateractivespeakers.h" 59#include "llfloateractivespeakers.h"
60#include "llfloateravatarinfo.h" 60#include "llfloateravatarinfo.h"
61#include "llfloaterchat.h" 61#include "llfloaterchat.h"
62#include "llfloaterfriends.h"
62#include "llkeyboard.h" 63#include "llkeyboard.h"
63#include "lllineeditor.h" 64#include "lllineeditor.h"
64#include "llmenucommands.h" 65#include "llmenucommands.h"
@@ -1133,7 +1134,8 @@ LLFloaterIMPanel::LLFloaterIMPanel(
1133 mSpeakers(NULL), 1134 mSpeakers(NULL),
1134 mSpeakerPanel(NULL), 1135 mSpeakerPanel(NULL),
1135 mFirstKeystrokeTimer(), 1136 mFirstKeystrokeTimer(),
1136 mLastKeystrokeTimer() 1137 mLastKeystrokeTimer(),
1138 mIMPanelType(IM_PANEL_PLAIN)
1137{ 1139{
1138 mSessionInitialTargetIDs = ids; 1140 mSessionInitialTargetIDs = ids;
1139 init(session_label); 1141 init(session_label);
@@ -1151,27 +1153,32 @@ void LLFloaterIMPanel::init(const std::string& session_label)
1151 mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this); 1153 mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this);
1152 xml_filename = "floater_instant_message_group.xml"; 1154 xml_filename = "floater_instant_message_group.xml";
1153 mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel); 1155 mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel);
1156 mIMPanelType = IM_PANEL_GROUP;
1154 break; 1157 break;
1155 case IM_SESSION_INVITE: 1158 case IM_SESSION_INVITE:
1156 mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this); 1159 mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this);
1157 if (gAgent.isInGroup(mSessionUUID)) 1160 if (gAgent.isInGroup(mSessionUUID))
1158 { 1161 {
1159 xml_filename = "floater_instant_message_group.xml"; 1162 xml_filename = "floater_instant_message_group.xml";
1163 mIMPanelType = IM_PANEL_GROUP;
1160 } 1164 }
1161 else // must be invite to ad hoc IM 1165 else // must be invite to ad hoc IM
1162 { 1166 {
1163 xml_filename = "floater_instant_message_ad_hoc.xml"; 1167 xml_filename = "floater_instant_message_ad_hoc.xml";
1168 mIMPanelType = IM_PANEL_CONFERENCE;
1164 } 1169 }
1165 mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel); 1170 mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel);
1166 break; 1171 break;
1167 case IM_SESSION_P2P_INVITE: 1172 case IM_SESSION_P2P_INVITE:
1168 xml_filename = "floater_instant_message.xml"; 1173 xml_filename = "floater_instant_message.xml";
1169 mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mSessionLabel, mOtherParticipantUUID); 1174 mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mSessionLabel, mOtherParticipantUUID);
1175 mIMPanelType = IM_PANEL_PLAIN;
1170 break; 1176 break;
1171 case IM_SESSION_CONFERENCE_START: 1177 case IM_SESSION_CONFERENCE_START:
1172 mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this); 1178 mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this);
1173 xml_filename = "floater_instant_message_ad_hoc.xml"; 1179 xml_filename = "floater_instant_message_ad_hoc.xml";
1174 mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel); 1180 mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel);
1181 mIMPanelType = IM_PANEL_CONFERENCE;
1175 break; 1182 break;
1176 // just received text from another user 1183 // just received text from another user
1177 case IM_NOTHING_SPECIAL: 1184 case IM_NOTHING_SPECIAL:
@@ -1183,10 +1190,12 @@ void LLFloaterIMPanel::init(const std::string& session_label)
1183 mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID); 1190 mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID);
1184 1191
1185 mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mSessionLabel, mOtherParticipantUUID); 1192 mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mSessionLabel, mOtherParticipantUUID);
1193 mIMPanelType = IM_PANEL_PLAIN;
1186 break; 1194 break;
1187 default: 1195 default:
1188 llwarns << "Unknown session type" << llendl; 1196 llwarns << "Unknown session type" << llendl;
1189 xml_filename = "floater_instant_message.xml"; 1197 xml_filename = "floater_instant_message.xml";
1198 mIMPanelType = IM_PANEL_PLAIN;
1190 break; 1199 break;
1191 } 1200 }
1192 1201
@@ -1296,6 +1305,14 @@ BOOL LLFloaterIMPanel::postBuild()
1296 1305
1297 // Profile combobox in floater_instant_message.xml 1306 // Profile combobox in floater_instant_message.xml
1298 childSetCommitCallback("profile_callee_btn", onCommitCombo, this); 1307 childSetCommitCallback("profile_callee_btn", onCommitCombo, this);
1308 LLComboBox* comboBox = getChild<LLComboBox>("profile_callee_btn");
1309 if (LLAvatarTracker::instance().getBuddyInfo(mOtherParticipantUUID) == NULL)
1310 {
1311 comboBox->add(getString("add_friend_string"), ADD_TOP);
1312 }
1313 comboBox->setCommitCallback(onCommitCombo);
1314 comboBox->setCallbackUserData(this);
1315
1299 childSetCommitCallback("group_info_btn", onCommitCombo, this); 1316 childSetCommitCallback("group_info_btn", onCommitCombo, this);
1300 1317
1301 childSetAction("start_call_btn", onClickStartCall, this); 1318 childSetAction("start_call_btn", onClickStartCall, this);
@@ -1875,27 +1892,32 @@ void LLFloaterIMPanel::onCommitCombo(LLUICtrl* caller, void* userdata)
1875 } 1892 }
1876 } 1893 }
1877 } 1894 }
1878 else if (caller->getValue().asString() == "pay_entry") 1895 // profile
1879 { 1896 else if (self->getIMType() == IM_PANEL_PLAIN)
1880 handle_pay_by_id(self->getOtherParticipantID());
1881 }
1882 else if (caller->getValue().asString() == "teleport_entry")
1883 {
1884 handle_lure(self->getOtherParticipantID());
1885 }
1886 else
1887 { 1897 {
1888 // group 1898 if (caller->getValue().asString() == "pay_entry")
1889 if (self->getOtherParticipantID() == self->getSessionID())
1890 { 1899 {
1891 LLFloaterGroupInfo::showFromUUID(self->getSessionID()); 1900 handle_pay_by_id(self->getOtherParticipantID());
1892 } 1901 }
1893 // profile 1902 else if (caller->getValue().asString() == "teleport_entry")
1894 else 1903 {
1904 handle_lure(self->getOtherParticipantID());
1905 }
1906 else if (caller->getValue().asString() == self->getString("add_friend_string"))
1907 {
1908 std::string fullname = self->getTitle();
1909 LLPanelFriends::requestFriendshipDialog(self->getOtherParticipantID(), fullname);
1910 }
1911 else
1895 { 1912 {
1896 LLFloaterAvatarInfo::showFromDirectory(self->getOtherParticipantID()); 1913 LLFloaterAvatarInfo::showFromDirectory(self->getOtherParticipantID());
1897 } 1914 }
1898 } 1915 }
1916 // group
1917 else if (self->getIMType() == IM_PANEL_GROUP)
1918 {
1919 LLFloaterGroupInfo::showFromUUID(self->getSessionID());
1920 }
1899 } 1921 }
1900} 1922}
1901 1923