From 619e2ca6c7d681884da698c83d2dd63ed7c25207 Mon Sep 17 00:00:00 2001 From: Krzysztof Drewniak Date: Thu, 30 Jul 2015 17:10:44 -0700 Subject: Fix an issue where a chat was joined but messages couldn't be sent The message sending code expected a "chatname" attribute to be set on chats to which message were sent. When the chat-joined event fired, this attribute was not set. This caused sending messages from a chat-joined callback to fail. This commit fixes this issue by attempting to fall back to the name field on the conversation if the "chatname" attribute is not set. --- skypeweb/skypeweb_messages.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/skypeweb/skypeweb_messages.c b/skypeweb/skypeweb_messages.c index 4a95c25..21a5690 100644 --- a/skypeweb/skypeweb_messages.c +++ b/skypeweb/skypeweb_messages.c @@ -1074,8 +1074,12 @@ skypeweb_chat_send(PurpleConnection *pc, gint id, const gchar *message, PurpleMe chatconv = purple_conversations_find_chat(pc, id); chatname = purple_conversation_get_data(PURPLE_CONVERSATION(chatconv), "chatname"); - if (!chatname) - return -1; + if (!chatname) { + // Fix for a condition around the chat data and serv_got_joined_chat() + chatname = purple_conversation_get_name(PURPLE_CONVERSATION(chatconv)); + if (!chatname) + return -1; + } skypeweb_send_message(sa, chatname, message); -- cgit v1.2.3