Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/skype4pidgin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEion Robb <eion@robbmob.com>2017-04-20 09:49:46 +0300
committerEion Robb <eion@robbmob.com>2017-04-20 09:49:46 +0300
commita2ce688cad3579e6fd4078f7033d2086e9df64e0 (patch)
tree5f8b68658d17bc690e1ad9048ecc1f9b80d55b88
parent7aeffa76577108854a3a4200b930207e9db31349 (diff)
Fix for crash when receiving a typing notification from a chat room user who we don't know is in the chat room
See issue #543
-rw-r--r--skypeweb/skypeweb_messages.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/skypeweb/skypeweb_messages.c b/skypeweb/skypeweb_messages.c
index 4d47948..37286c4 100644
--- a/skypeweb/skypeweb_messages.c
+++ b/skypeweb/skypeweb_messages.c
@@ -191,19 +191,21 @@ process_message_resource(SkypeWebAccount *sa, JsonObject *resource)
}
cb = purple_chat_conversation_find_user(chatconv, from);
- cbflags = purple_chat_user_get_flags(cb);
-
- cbflags |= PURPLE_CHAT_USER_TYPING;
-
- // typing notification icon
- if (purple_account_get_bool(sa->account, "show-typing-as-icon", FALSE)) {
- cbflags |= PURPLE_CHAT_USER_VOICE;
+ if (cb != NULL) {
+ cbflags = purple_chat_user_get_flags(cb);
+
+ cbflags |= PURPLE_CHAT_USER_TYPING;
+
+ // typing notification icon
+ if (purple_account_get_bool(sa->account, "show-typing-as-icon", FALSE)) {
+ cbflags |= PURPLE_CHAT_USER_VOICE;
+ }
+
+ purple_chat_user_set_flags(cb, cbflags);
+
+ //purple_timeout_add_seconds(7, skypeweb_clear_typing_hack, cb);
}
- purple_chat_user_set_flags(cb, cbflags);
-
- //purple_timeout_add_seconds(7, skypeweb_clear_typing_hack, cb);
-
} else if ((g_str_equal(messagetype, "RichText") || g_str_equal(messagetype, "Text"))) {
gchar *html;
gint64 skypeemoteoffset = 0;
@@ -219,21 +221,15 @@ process_message_resource(SkypeWebAccount *sa, JsonObject *resource)
// Remove typing notification icon w/o "show-typing-as-icon" option check.
// Hard reset cbflags even if user changed settings while someone typing message.
- #if !PURPLE_VERSION_CHECK(3, 0, 0)
- cbflags = purple_conv_chat_user_get_flags(chatconv, from);
- (void) cb;
- #else
- cb = purple_chat_conversation_find_user(chatconv, from);
- cbflags = purple_chat_user_get_flags(cb);
- #endif
- cbflags &= ~PURPLE_CHAT_USER_TYPING & ~PURPLE_CHAT_USER_VOICE;
-
- #if !PURPLE_VERSION_CHECK(3, 0, 0)
- purple_conv_chat_user_set_flags(chatconv, from, cbflags);
- #else
+ cb = purple_chat_conversation_find_user(chatconv, from);
+ if (cb != NULL) {
+ cbflags = purple_chat_user_get_flags(cb);
+
+ cbflags &= ~PURPLE_CHAT_USER_TYPING & ~PURPLE_CHAT_USER_VOICE;
+
purple_chat_user_set_flags(cb, cbflags);
- #endif
+ }
if (content && *content) {
if (g_str_equal(messagetype, "Text")) {