Advertisement
tomkiewicz

pidgin-crash-fix

Feb 10th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.32 KB | None | 0 0
  1. diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
  2. --- a/pidgin/gtkconv.c
  3. +++ b/pidgin/gtkconv.c
  4. @@ -6459,8 +6459,11 @@
  5.             PIDGIN_CONVERSATION_THEME_TEMPLATE_OUTGOING_CONTENT);
  6.  
  7.     } else if ((flags & PURPLE_MESSAGE_RECV) && (old_flags & PURPLE_MESSAGE_RECV)) {
  8. -       GList *history = purple_conversation_get_message_history(conv);
  9. -       PurpleConvMessage *last_msg = (PurpleConvMessage *)history->data;
  10. +       GList *history = purple_conversation_get_message_history(gtkconv->last_conversed);
  11. +       PurpleConvMessage *last_msg = history ? (PurpleConvMessage *)history->data : NULL;
  12. +
  13. +       g_assert(history != NULL);
  14. +       g_assert(last_msg != NULL);
  15.  
  16.         /* If the senders are the same, use appendNextMessage */
  17.         if (purple_strequal(purple_conversation_message_get_sender(last_msg), name)) {
  18. @@ -6480,6 +6483,7 @@
  19.             PIDGIN_CONVERSATION_THEME_TEMPLATE_STATUS);
  20.     }
  21.     gtkconv->last_flags = flags;
  22. +   gtkconv->last_conversed = conv;
  23.  
  24.     smileyed = smiley_parse_markup(displaying, purple_account_get_protocol_id(account));
  25.     msg = replace_message_tokens(message_html, conv, name, alias, smileyed, flags, mtime);
  26. diff --git a/pidgin/gtkconv.h b/pidgin/gtkconv.h
  27. --- a/pidgin/gtkconv.h
  28. +++ b/pidgin/gtkconv.h
  29. @@ -83,6 +83,7 @@
  30.  struct _PidginConversation
  31.  {
  32.     PurpleConversation *active_conv;
  33. +   PurpleConversation *last_conversed;
  34.     GList *convs;
  35.     GList *send_history;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement