[Bug 38061] Add tp_message_set_message() method
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Jun 8 18:05:38 CEST 2011
https://bugs.freedesktop.org/show_bug.cgi?id=38061
--- Comment #2 from Will Thompson <will.thompson at collabora.co.uk> 2011-06-08 09:05:37 PDT ---
> Compliments tp_cm_message_take_message().
“Have you been working out, tp_cm_message_take_message()? You look great!”
+ g_return_if_fail (self != message);
Nice attention to detail. :)
+ g_hash_table_insert (g_ptr_array_index (self->parts, part),
+ g_strdup (key),
+ tp_g_value_slice_new_boxed (TP_ARRAY_TYPE_MESSAGE_PART_LIST,
+ message->parts));
I *believe* that this will not copy the message parts, just ref 'em. In other
words, if you modify @message after calling tp_cm_message_set_message(), it
will also modify the copy in @self.
We need to document this one way or another.
We could just say that this is the case: but I bet it will trip people up.
There have been bugs in Wocky due to repeatedly passing the same WockyStanza *
to wocky_porter_send_async(), changing (say) its recipient each time, and
accidentally sending n copies of the stanza to the last recipient.
Or we could explicitly copy @message. (It could be that this is actually
already what happens, in which case, ideal!)
I leave the decision in your capable hands.
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list