GNOME Bugzilla – Bug 622118
Empathy should send actions verbatim if not supported by the network
Last modified: 2011-04-06 09:50:14 UTC
Hi Typing /me when chatting with a MSN contact (connected to MSN with butterfly), I get an error: "- Error sending message "test": unknown" If the network (or CM) doesn't support an action, I guess that the text should be sent verbatim.
Right, Empathy should check that the Action type is supported. http://telepathy.freedesktop.org/spec/Channel_Type_Text.html#org.freedesktop.Telepathy.Channel.Type.Text.GetMessageTypes
Created attachment 185266 [details] [review] send '/me' message verbatim if CM doesn't support Action messages (#622118)
+ tmp = g_strdup_printf ("/me %s", strv[1]); This can confuse non-English speakers. I wonder if we shouldn't set it to "%s %s", self_alias, strv[1] ?
Good point, but that's trickier that it looks. The EmpathyChat doesn't have a reference on our self TpContact (or EmpathyContact), so that means we'll have to request a TpContact asynchronoulsy and delay sending of the message until this call succeeds. That's, imho, a bit overkill for such fallback and, worst, can break ordering of sent messages as if user sends another not /me message right after, it may be sent before this one.
EmpathyTpChat has a reference to our EmpathyContact though. Can't you get it with tp_chat_get_members(), or add an accessor for it? I agree that doing an async call to get it is a bad idea.
Created attachment 185272 [details] [review] add empathy_tp_chat_get_self_contact()
Created attachment 185273 [details] [review] emulate '/me' command if CM doesn't support Action messages (#622118)
+EmpathyContact * +empathy_tp_chat_get_self_contact (EmpathyTpChat *self) +{ + EmpathyTpChatPriv *priv = GET_PRIV (self); Maybe add a g_return_val_if_fail (EMPATHY_IS_TP_CHAT (self), NULL); ? Looks fine otherwise.
Merged to master; thanks! This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.