aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llinstantmessage.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llmessage/llinstantmessage.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llmessage/llinstantmessage.cpp')
-rw-r--r--linden/indra/llmessage/llinstantmessage.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/linden/indra/llmessage/llinstantmessage.cpp b/linden/indra/llmessage/llinstantmessage.cpp
index 390a6fa..5012741 100644
--- a/linden/indra/llmessage/llinstantmessage.cpp
+++ b/linden/indra/llmessage/llinstantmessage.cpp
@@ -59,7 +59,7 @@ const S32 VOTE_UNANIMOUS = 2;
59const char EMPTY_BINARY_BUCKET[] = ""; 59const char EMPTY_BINARY_BUCKET[] = "";
60const S32 EMPTY_BINARY_BUCKET_SIZE = 1; 60const S32 EMPTY_BINARY_BUCKET_SIZE = 1;
61const U32 NO_TIMESTAMP = 0; 61const U32 NO_TIMESTAMP = 0;
62const char SYSTEM_FROM[] = "Second Life"; 62const std::string SYSTEM_FROM("Second Life");
63const S32 IM_TTL = 1; 63const S32 IM_TTL = 1;
64 64
65 65
@@ -144,8 +144,8 @@ void LLIMInfo::packMessageBlock(LLMessageSystem* msg) const
144 mFromGroup, 144 mFromGroup,
145 LLUUID::null, 145 LLUUID::null,
146 mToID, 146 mToID,
147 mName.c_str(), 147 mName,
148 mMessage.c_str(), 148 mMessage,
149 mOffline, 149 mOffline,
150 mIMType, 150 mIMType,
151 mID, 151 mID,
@@ -163,8 +163,8 @@ void pack_instant_message(
163 BOOL from_group, 163 BOOL from_group,
164 const LLUUID& session_id, 164 const LLUUID& session_id,
165 const LLUUID& to_id, 165 const LLUUID& to_id,
166 const char* name, 166 const std::string& name,
167 const char* message, 167 const std::string& message,
168 U8 offline, 168 U8 offline,
169 EInstantMessage dialog, 169 EInstantMessage dialog,
170 const LLUUID& id, 170 const LLUUID& id,
@@ -202,8 +202,8 @@ void pack_instant_message_block(
202 BOOL from_group, 202 BOOL from_group,
203 const LLUUID& session_id, 203 const LLUUID& session_id,
204 const LLUUID& to_id, 204 const LLUUID& to_id,
205 const char* name, 205 const std::string& name,
206 const char* message, 206 const std::string& message,
207 U8 offline, 207 U8 offline,
208 EInstantMessage dialog, 208 EInstantMessage dialog,
209 const LLUUID& id, 209 const LLUUID& id,
@@ -229,10 +229,10 @@ void pack_instant_message_block(
229 msg->addU32Fast(_PREHASH_Timestamp, timestamp); 229 msg->addU32Fast(_PREHASH_Timestamp, timestamp);
230 msg->addStringFast(_PREHASH_FromAgentName, name); 230 msg->addStringFast(_PREHASH_FromAgentName, name);
231 S32 bytes_left = MTUBYTES; 231 S32 bytes_left = MTUBYTES;
232 if(message) 232 if(!message.empty())
233 { 233 {
234 char buffer[MTUBYTES]; 234 char buffer[MTUBYTES];
235 int num_written = snprintf(buffer, MTUBYTES, "%s", message); /* Flawfinder: ignore */ 235 int num_written = snprintf(buffer, MTUBYTES, "%s", message.c_str()); /* Flawfinder: ignore */
236 // snprintf returns number of bytes that would have been written 236 // snprintf returns number of bytes that would have been written
237 // had the output not being truncated. In that case, it will 237 // had the output not being truncated. In that case, it will
238 // return either -1 or value >= passed in size value . So a check needs to be added 238 // return either -1 or value >= passed in size value . So a check needs to be added
@@ -281,13 +281,9 @@ void LLIMInfo::unpackMessageBlock(LLMessageSystem* msg)
281 mIMType = (EInstantMessage) dialog; 281 mIMType = (EInstantMessage) dialog;
282 msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, mID); 282 msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, mID);
283 msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_Timestamp, mTimeStamp); 283 msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_Timestamp, mTimeStamp);
284 char name[DB_FULL_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ 284 msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, mName);
285 msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, DB_FULL_NAME_BUF_SIZE, name);
286 mName.assign(name);
287 285
288 char message[DB_IM_MSG_BUF_SIZE]; /*Flawfinder: ignore*/ 286 msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, mMessage);
289 msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, DB_IM_MSG_BUF_SIZE, message);
290 mMessage.assign(message);
291 287
292 S32 binary_bucket_size = llmin( 288 S32 binary_bucket_size = llmin(
293 MTUBYTES, 289 MTUBYTES,