diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmessage/llinstantmessage.cpp | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/linden/indra/llmessage/llinstantmessage.cpp b/linden/indra/llmessage/llinstantmessage.cpp index 0ba7629..0a3a1e6 100644 --- a/linden/indra/llmessage/llinstantmessage.cpp +++ b/linden/indra/llmessage/llinstantmessage.cpp | |||
@@ -328,18 +328,46 @@ LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info) | |||
328 | param_message["parent_estate_id"] = (S32)im_info->mParentEstateID; | 328 | param_message["parent_estate_id"] = (S32)im_info->mParentEstateID; |
329 | param_message["region_id"] = im_info->mRegionID; | 329 | param_message["region_id"] = im_info->mRegionID; |
330 | param_message["position"] = ll_sd_from_vector3(im_info->mPosition); | 330 | param_message["position"] = ll_sd_from_vector3(im_info->mPosition); |
331 | if (im_info->mData) param_message["data"] = im_info->mData; | 331 | param_message["data"] = im_info->mData; |
332 | param_message["source"]= im_info->mSource; | ||
333 | param_message["ttl"] = im_info->mTTL; | ||
334 | |||
332 | LLSD param_agent; | 335 | LLSD param_agent; |
333 | param_agent["agent_id"] = im_info->mFromID; | 336 | param_agent["agent_id"] = im_info->mFromID; |
334 | 337 | ||
335 | LLSD params; | 338 | LLSD params; |
336 | params.append(param_version); | 339 | params["version_params"] = param_version; |
337 | params.append(param_message); | 340 | params["message_params"] = param_message; |
338 | params.append(param_agent); | 341 | params["agent_params"] = param_agent; |
339 | 342 | ||
340 | return params; | 343 | return params; |
341 | } | 344 | } |
342 | 345 | ||
346 | LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd) | ||
347 | { | ||
348 | LLSD param_message = im_info_sd["message_params"]; | ||
349 | LLSD param_agent = im_info_sd["agent_params"]; | ||
350 | |||
351 | LLPointer<LLIMInfo> im_info = new LLIMInfo( | ||
352 | param_message["from_id"].asUUID(), | ||
353 | param_message["from_group"].asBoolean(), | ||
354 | param_message["to_id"].asUUID(), | ||
355 | (EInstantMessage) param_message["type"].asInteger(), | ||
356 | param_message["from_name"].asString(), | ||
357 | param_message["message"].asString(), | ||
358 | param_message["id"].asUUID(), | ||
359 | (U32) param_message["parent_estate_id"].asInteger(), | ||
360 | im_info->mRegionID = param_message["region_id"].asUUID(), | ||
361 | ll_vector3_from_sd(param_message["position"]), | ||
362 | param_message["data"], | ||
363 | (U8) param_message["offline"].asInteger(), | ||
364 | (U32) param_message["timestamp"].asInteger(), | ||
365 | (EIMSource)param_message["source"].asInteger(), | ||
366 | param_message["ttl"].asInteger()); | ||
367 | |||
368 | return im_info; | ||
369 | } | ||
370 | |||
343 | LLPointer<LLIMInfo> LLIMInfo::clone() | 371 | LLPointer<LLIMInfo> LLIMInfo::clone() |
344 | { | 372 | { |
345 | return new LLIMInfo( | 373 | return new LLIMInfo( |