Hello community,

here is the log from the commit of package mcabber for openSUSE:Factory checked 
in at 2017-02-13 07:49:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mcabber (Old)
 and      /work/SRC/openSUSE:Factory/.mcabber.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mcabber"

Changes:
--------
--- /work/SRC/openSUSE:Factory/mcabber/mcabber.changes  2016-12-10 
18:30:47.648089726 +0100
+++ /work/SRC/openSUSE:Factory/.mcabber.new/mcabber.changes     2017-02-13 
07:49:54.651463634 +0100
@@ -1,0 +2,9 @@
+Fri Feb 10 14:15:22 UTC 2017 - [email protected]
+
+- Update to version 1.0.5:
+  * Much better performances with huge rosters.
+  * Fix an issue with carbons (CVE-2017-5589, bsc#1024690).
+  * Fix a small memory leak.
+  * contrib/vim: Support reloading filetype detection.
+
+-------------------------------------------------------------------

Old:
----
  mcabber-1.0.4.tar.bz2
  mcabber-1.0.4.tar.bz2.asc

New:
----
  mcabber-1.0.5.tar.bz2
  mcabber-1.0.5.tar.bz2.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mcabber.spec ++++++
--- /var/tmp/diff_new_pack.2XRgfz/_old  2017-02-13 07:49:55.351363708 +0100
+++ /var/tmp/diff_new_pack.2XRgfz/_new  2017-02-13 07:49:55.351363708 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package mcabber
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,14 @@
 
 
 Name:           mcabber
-Version:        1.0.4
+Version:        1.0.5
 Release:        0
 Summary:        Modular XMPP client on ncurses
 License:        GPL-2.0+
 Group:          Productivity/Networking/Instant Messenger
-Url:            http://mcabber.com/
-Source:         http://mcabber.com/files/%{name}-%{version}.tar.bz2
-Source1:        http://mcabber.com/files/%{name}-%{version}.tar.bz2.asc
+Url:            https://mcabber.com/
+Source:         https://mcabber.com/files/%{name}-%{version}.tar.bz2
+Source1:        https://mcabber.com/files/%{name}-%{version}.tar.bz2.asc
 Source2:        %{name}.keyring
 # PATCH-FEATURE-OPENSUSE up_one_line_message_length.patch
 Patch0:         up_one_line_message_length.patch

++++++ mcabber-1.0.4.tar.bz2 -> mcabber-1.0.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/ChangeLog new/mcabber-1.0.5/ChangeLog
--- old/mcabber-1.0.4/ChangeLog 2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/ChangeLog 2017-01-29 21:40:20.000000000 +0100
@@ -1,3 +1,12 @@
+mcabber (1.0.5)
+
+ * Much better performances with huge rosters (Frank Zschockelt)
+ * Fix issue with carbons
+ * Fix small memory leak
+ * contrib/vim: Support reloading filetype detection
+
+ -- Mikael, 2017-01-29
+
 mcabber (1.0.4)
 
  * Bugfix: Check the origin of roster pushes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/ChangeLog.api 
new/mcabber-1.0.5/ChangeLog.api
--- old/mcabber-1.0.4/ChangeLog.api     2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/ChangeLog.api     2017-01-29 21:40:20.000000000 +0100
@@ -1,5 +1,6 @@
 dev (41)
 
+ * Stable api 1.0.5:1
  * Stable api 1.0.4:1
  * Stable api 1.0.3:1
  * Stable api 1.0.2:1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/configure new/mcabber-1.0.5/configure
--- old/mcabber-1.0.4/configure 2016-11-21 20:47:37.000000000 +0100
+++ new/mcabber-1.0.5/configure 2017-01-29 21:40:23.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mcabber 1.0.4.
+# Generated by GNU Autoconf 2.69 for mcabber 1.0.5.
 #
 # Report bugs to <[email protected]>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='mcabber'
 PACKAGE_TARNAME='mcabber'
-PACKAGE_VERSION='1.0.4'
-PACKAGE_STRING='mcabber 1.0.4'
+PACKAGE_VERSION='1.0.5'
+PACKAGE_STRING='mcabber 1.0.5'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_URL=''
 
@@ -1365,7 +1365,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mcabber 1.0.4 to adapt to many kinds of systems.
+\`configure' configures mcabber 1.0.5 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1435,7 +1435,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mcabber 1.0.4:";;
+     short | recursive ) echo "Configuration of mcabber 1.0.5:";;
    esac
   cat <<\_ACEOF
 
@@ -1574,7 +1574,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mcabber configure 1.0.4
+mcabber configure 1.0.5
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2100,7 +2100,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mcabber $as_me 1.0.4, which was
+It was created by mcabber $as_me 1.0.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2967,7 +2967,7 @@
 
 # Define the identity of the package.
  PACKAGE='mcabber'
- VERSION='1.0.4'
+ VERSION='1.0.5'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16622,10 +16622,10 @@
 
 # Prepare some config.h variables
 
-$as_echo "#define MCABBER_BRANCH \"1.0.4\"" >>confdefs.h
+$as_echo "#define MCABBER_BRANCH \"1.0.5\"" >>confdefs.h
 
 
-$as_echo "#define MCABBER_VERSION \"1.0.4\"" >>confdefs.h
+$as_echo "#define MCABBER_VERSION \"1.0.5\"" >>confdefs.h
 
 
 # We need _GNU_SOURCE for strptime() and strcasestr()
@@ -17179,7 +17179,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mcabber $as_me 1.0.4, which was
+This file was extended by mcabber $as_me 1.0.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -17245,7 +17245,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-mcabber config.status 1.0.4
+mcabber config.status 1.0.5
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/configure.ac 
new/mcabber-1.0.5/configure.ac
--- old/mcabber-1.0.4/configure.ac      2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/configure.ac      2017-01-29 21:40:20.000000000 +0100
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT([mcabber],[1.0.4],[[email protected]])
+AC_INIT([mcabber],[1.0.5],[[email protected]])
 XC_AUTOMAKE
 AC_CONFIG_SRCDIR([mcabber])
 AC_CONFIG_HEADERS([mcabber/config.h])
@@ -297,7 +297,7 @@
 AM_CONDITIONAL([INSTALL_HEADERS], [test x$enable_modules != xno])
 
 # Prepare some config.h variables
-AC_DEFINE([MCABBER_BRANCH], "1.0.4", [Mcabber branch])
+AC_DEFINE([MCABBER_BRANCH], "1.0.5", [Mcabber branch])
 AC_DEFINE([MCABBER_VERSION], "AC_PACKAGE_VERSION", [Mcabber version string])
 
 # We need _GNU_SOURCE for strptime() and strcasestr()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/contrib/vim/mcabber_log-ftdetect.vim 
new/mcabber-1.0.5/contrib/vim/mcabber_log-ftdetect.vim
--- old/mcabber-1.0.4/contrib/vim/mcabber_log-ftdetect.vim      2016-11-21 
20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/contrib/vim/mcabber_log-ftdetect.vim      2017-01-29 
21:40:20.000000000 +0100
@@ -1,7 +1,7 @@
 "
 " Save this file in your ~/.vim/ftdetect/ folder
 
-function MCabber_log_ftdetect()
+function! MCabber_log_ftdetect()
     if getline(1) =~ '^\u. \d\{8}T\d\d:\d\d:\d\dZ \d\{3} '
       setlocal filetype=mcabber_log
     endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/doc/mcabber.1 
new/mcabber-1.0.5/doc/mcabber.1
--- old/mcabber-1.0.4/doc/mcabber.1     2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/doc/mcabber.1     2017-01-29 21:40:20.000000000 +0100
@@ -4,10 +4,10 @@
 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
 .\"      Date: 09/18/2016
 .\"    Manual: \ \&
-.\"    Source: \ \& 1.0.4
+.\"    Source: \ \& 1.0.5
 .\"  Language: English
 .\"
-.TH "MCABBER" "1" "11/21/2016" "\ \& 1\&.0\&.4\" "\ \&"
+.TH "MCABBER" "1" "09/18/2016" "v1\&.0\&.5"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/doc/mcabber.1.html 
new/mcabber-1.0.5/doc/mcabber.1.html
--- old/mcabber-1.0.4/doc/mcabber.1.html        2016-11-21 20:47:26.000000000 
+0100
+++ new/mcabber-1.0.5/doc/mcabber.1.html        2017-01-29 21:40:20.000000000 
+0100
@@ -2616,8 +2616,8 @@
 <div id="footnotes"><hr /></div>
 <div id="footer">
 <div id="footer-text">
-Version 1.0.4<br />
-Last updated 2016-11-21 10:08:00 CEST
+Version 1.0.5<br />
+Last updated 2016-09-17 20:57:35 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/doc/mcabber.1.txt 
new/mcabber-1.0.5/doc/mcabber.1.txt
--- old/mcabber-1.0.4/doc/mcabber.1.txt 2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/doc/mcabber.1.txt 2017-01-29 21:40:20.000000000 +0100
@@ -1,7 +1,7 @@
 MCABBER(1)
 ===========
 Mikael BERTHE <[email protected]>
-v1.0.4, November 2016
+v1.0.5, January 2017
 
 NAME
 ----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/commands.c 
new/mcabber-1.0.5/mcabber/commands.c
--- old/mcabber-1.0.4/mcabber/commands.c        2016-11-21 20:47:26.000000000 
+0100
+++ new/mcabber-1.0.5/mcabber/commands.c        2017-01-29 21:40:20.000000000 
+0100
@@ -568,7 +568,6 @@
 static void roster_buddylock(char *bjid, int lock)
 {
   gpointer bud = NULL;
-  bool may_need_refresh = FALSE;
 
   // Allow special jid "" or "." (current buddy)
   if (bjid && (!*bjid || !strcmp(bjid, ".")))
@@ -588,7 +587,6 @@
         bud = roster_elt->data;
       else
         scr_LogPrint(LPRINT_NORMAL, "This jid isn't in the roster.");
-      may_need_refresh = TRUE;
     }
   } else {
     // Use the current buddy
@@ -601,10 +599,8 @@
     if (lock == -1)
       lock = !(buddy_getflags(bud) & ROSTER_FLAG_USRLOCK);
     buddy_setflags(bud, ROSTER_FLAG_USRLOCK, lock);
-    if (may_need_refresh) {
-      buddylist_build();
-      update_roster = TRUE;
-    }
+    buddylist_defer_build();
+    scr_update_roster();
   }
 }
 
@@ -820,10 +816,8 @@
 
   if (!strcasecmp(subcmd, "top")) {
     scr_roster_top();
-    update_roster = TRUE;
   } else if (!strcasecmp(subcmd, "bottom")) {
     scr_roster_bottom();
-    update_roster = TRUE;
   } else if (!strcasecmp(subcmd, "hide")) {
     scr_roster_visibility(0);
   } else if (!strcasecmp(subcmd, "show")) {
@@ -832,17 +826,13 @@
     scr_roster_visibility(-1);
   } else if (!strcasecmp(subcmd, "hide_offline")) {
     buddylist_set_hide_offline_buddies(TRUE);
-    if (current_buddy)
-      buddylist_build();
-    update_roster = TRUE;
+    scr_update_roster();
   } else if (!strcasecmp(subcmd, "show_offline")) {
     buddylist_set_hide_offline_buddies(FALSE);
-    buddylist_build();
-    update_roster = TRUE;
+    scr_update_roster();
   } else if (!strcasecmp(subcmd, "toggle_offline")) {
     buddylist_set_hide_offline_buddies(-1);
-    buddylist_build();
-    update_roster = TRUE;
+    scr_update_roster();
   } else if (!strcasecmp(subcmd, "display")) {
     scr_roster_display(arg);
   } else if (!strcasecmp(subcmd, "item_lock")) {
@@ -867,7 +857,6 @@
       return;
     }
     scr_roster_search(arg);
-    update_roster = TRUE;
   } else if (!strcasecmp(subcmd, "up")) {
     roster_updown(-1, arg);
   } else if (!strcasecmp(subcmd, "down")) {
@@ -913,13 +902,11 @@
 
     if (status && !strcmp(status, "clear")) { // Not a color command, clear all
       scr_roster_clear_color();
-      update_roster = TRUE;
     } else {
       if (!status || !*status || !wildcard || !*wildcard || !color || !*color) 
{
         scr_LogPrint(LPRINT_NORMAL, "Missing argument");
       } else {
-        update_roster = scr_roster_color(status, wildcard, color) ||
-                        update_roster;
+        scr_roster_color(status, wildcard, color);
       }
     }
     free_arg_lst(arglist);
@@ -1257,8 +1244,8 @@
 
   buddy_hide_group(group, group_state);
 
-  buddylist_build();
-  update_roster = TRUE;
+  buddylist_defer_build();
+  scr_update_roster();
 
 do_group_return:
   free_arg_lst(paramlst);
@@ -2227,7 +2214,7 @@
 
   g_free(name_utf8);
   g_free(newname);
-  update_roster = TRUE;
+  scr_update_roster();
 }
 
 static void do_move(char *arg)
@@ -2296,7 +2283,7 @@
 
   g_free(group_utf8);
   g_free(newgroupname);
-  update_roster = TRUE;
+  scr_update_roster();
 }
 
 static void list_option_cb(char *k, char *v, void *f)
@@ -2402,7 +2389,7 @@
   assign = parse_assigment(arg, &alias, &value);
   if (!alias) {
     settings_foreach(SETTINGS_TYPE_ALIAS, &dump_alias, NULL);
-    update_roster = TRUE;
+    scr_update_roster();
     return;
   }
   if (!assign) {  // This is a query
@@ -2627,8 +2614,8 @@
   g_free(roomname_tmp);
   g_free(nick);
   g_free(pass_utf8);
-  buddylist_build();
-  update_roster = TRUE;
+  buddylist_defer_build();
+  scr_update_roster();
   free_arg_lst(paramlst);
 }
 
@@ -2926,8 +2913,8 @@
   // Delete the room
   roster_del_user(buddy_getjid(bud));
   scr_update_buddy_window();
-  buddylist_build();
-  update_roster = TRUE;
+  buddylist_defer_build();
+  scr_update_roster();
 }
 
 static void room_topic(gpointer bud, char *arg)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/hooks.c 
new/mcabber-1.0.5/mcabber/hooks.c
--- old/mcabber-1.0.4/mcabber/hooks.c   2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/mcabber/hooks.c   2017-01-29 21:40:20.000000000 +0100
@@ -436,7 +436,7 @@
       (buddy_getstatus(roster_usr->data, NULL) == offline &&
        buddylist_isset_filter()))
   {
-    update_roster = TRUE;
+    scr_update_roster();
   }
 
   g_free(bmsg);
@@ -567,8 +567,8 @@
 
   roster_setstatus(bjid, rn, prio, status, status_msg, timestamp,
                    role_none, affil_none, NULL);
-  buddylist_build();
-  scr_draw_roster();
+  buddylist_defer_build();
+  scr_update_roster();
   hlog_write_status(bjid, timestamp, status, status_msg);
 
 #ifdef MODULES_ENABLE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/main.c 
new/mcabber-1.0.5/mcabber/main.c
--- old/mcabber-1.0.4/mcabber/main.c    2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/mcabber/main.c    2017-01-29 21:40:20.000000000 +0100
@@ -563,8 +563,7 @@
         sigwinch = FALSE;
       }
 #endif
-      if (update_roster)
-        scr_draw_roster();
+      scr_draw_roster();
       scr_do_update();
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/roster.c 
new/mcabber-1.0.5/mcabber/roster.c
--- old/mcabber-1.0.4/mcabber/roster.c  2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/mcabber/roster.c  2017-01-29 21:40:20.000000000 +0100
@@ -121,6 +121,7 @@
 static GSList *unread_list;
 static GHashTable *unread_jids;
 GList *buddylist;
+static gboolean _rebuild_buddylist = FALSE;
 GList *current_buddy;
 GList *alternate_buddy;
 GList *last_activity_buddy;
@@ -472,7 +473,7 @@
 
   // We need to rebuild the list
   if (current_buddy)
-    buddylist_build();
+    buddylist_defer_build();
   // TODO What we could do, too, is to check if the deleted node is
   // current_buddy, in which case we could move current_buddy to the
   // previous (or next) node.
@@ -518,7 +519,7 @@
     groups = NULL;
     // Update (i.e. free) buddylist
     if (buddylist)
-      buddylist_build();
+      buddylist_defer_build();
   }
 }
 
@@ -718,7 +719,7 @@
   }
 
   if (buddylist && (new_roster_item || !g_list_find(buddylist, roster_usr)))
-    buddylist_build();
+    buddylist_defer_build();
 
 roster_msg_setflag_return:
   if (unread_list_modified) {
@@ -927,6 +928,7 @@
   } else {                      // TRUE  (hide -- andfo)
     display_filter = DFILTER_ONLINE;
   }
+  buddylist_defer_build();
 }
 
 int buddylist_isset_filter(void)
@@ -949,6 +951,11 @@
   return display_filter;
 }
 
+void buddylist_defer_build(void)
+{
+  _rebuild_buddylist = TRUE;
+}
+
 //  buddylist_build()
 // Creates the buddylist from the roster entries.
 void buddylist_build(void)
@@ -960,6 +967,10 @@
   roster *roster_last_activity_buddy = NULL;
   int shrunk_group;
 
+  if (_rebuild_buddylist == FALSE)
+    return;
+  _rebuild_buddylist = FALSE;
+
   // We need to remember which buddy is selected.
   if (current_buddy)
     roster_current_buddy = BUDDATA(current_buddy);
@@ -1094,7 +1105,7 @@
   my_newgroup->list = g_slist_insert_sorted(my_newgroup->list, roster_usr,
                                             
(GCompareFunc)&roster_compare_name);
 
-  buddylist_build();
+  buddylist_defer_build();
 }
 
 void buddy_setname(gpointer rosterdata, char *newname)
@@ -1118,7 +1129,7 @@
   sl_group = &((roster*)((GSList*)roster_usr->list)->data)->list;
   *sl_group = g_slist_sort(*sl_group, (GCompareFunc)&roster_compare_name);
 
-  buddylist_build();
+  buddylist_defer_build();
 }
 
 const char *buddy_getname(gpointer rosterdata)
@@ -1552,6 +1563,7 @@
   GList *buddy;
   roster *roster_usr;
 
+  buddylist_build();
   if (!buddylist) return NULL;
 
   for (buddy = buddylist; buddy; buddy = g_list_next(buddy)) {
@@ -1570,6 +1582,7 @@
 {
   GList *buddy = current_buddy;
   roster *roster_usr;
+  buddylist_build();
   if (!buddylist || !current_buddy) return NULL;
   for (;;) {
     gchar *jid_locale, *name_locale;
@@ -1749,29 +1762,16 @@
   return g_hash_table_remove(unread_jids, jid);
 }
 
-// Helper function for unread_jid_get_list()
-static void add_to_unreadjids(gpointer key, gpointer value, gpointer udata)
-{
-  GList **listp = udata;
-  *listp = g_list_append(*listp, key);
-}
-
 //  unread_jid_get_list()
 // Return the JID list.
 // The content of the list should not be modified or freed.
 // The caller should call g_list_free() after use.
 GList *unread_jid_get_list(void)
 {
-  GList *list = NULL;
-
   if (!unread_jids)
     return NULL;
 
-  // g_hash_table_get_keys() is only in glib >= 2.14
-  //return g_hash_table_get_keys(unread_jids);
-
-  g_hash_table_foreach(unread_jids, add_to_unreadjids, &list);
-  return list;
+  return g_hash_table_get_keys(unread_jids);
 }
 
 /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2:  For Vim users... */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/roster.h 
new/mcabber-1.0.5/mcabber/roster.h
--- old/mcabber-1.0.4/mcabber/roster.h  2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/mcabber/roster.h  2017-01-29 21:40:20.000000000 +0100
@@ -190,6 +190,7 @@
 guint   roster_getsubscription(const char *jid);
 void    roster_unsubscribed(const char *jid);
 
+void    buddylist_defer_build(void);
 void    buddylist_build(void);
 void    buddy_hide_group(gpointer rosterdata, int hide);
 void    buddylist_set_hide_offline_buddies(int hide);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/screen.c 
new/mcabber-1.0.5/mcabber/screen.c
--- old/mcabber-1.0.4/mcabber/screen.c  2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/mcabber/screen.c  2017-01-29 21:40:20.000000000 +0100
@@ -156,7 +156,7 @@
 static time_t chatstate_timestamp;
 static guint  chatstate_timeout_id = 0;
 
-int update_roster;
+int _update_roster;
 int utf8_mode;
 gboolean chatstates_disabled;
 gboolean Autoaway;
@@ -382,6 +382,7 @@
   }
   g_slist_free(rostercolrules);
   rostercolrules = NULL;
+  scr_update_roster();
 }
 
 // Adds, modifies or removes roster coloring rule
@@ -407,6 +408,7 @@
     if (found) {
       free_rostercolrule(found->data);
       rostercolrules = g_slist_delete_link(rostercolrules, found);
+      scr_update_roster();
       return TRUE;
     } else {
       scr_LogPrint(LPRINT_NORMAL, "No such color rule, nothing removed");
@@ -430,6 +432,7 @@
       rc->color = cl;
       rostercolrules = g_slist_prepend(rostercolrules, rc);
     }
+    scr_update_roster();
     return TRUE;
   }
 }
@@ -1405,7 +1408,7 @@
     roster_msg_setflag(winId, special, FALSE);
   if (!special)
     roster_setflags(winId, ROSTER_FLAG_LOCK, TRUE);
-  update_roster = TRUE;
+  scr_update_roster();
 
   // Refresh the window
   scr_update_window(win_entry);
@@ -1555,17 +1558,17 @@
   if (!special) {
     if (clearmsgflg) {
       roster_msg_setflag(winId, FALSE, FALSE);
-      update_roster = TRUE;
+      scr_update_roster();
     } else if (setmsgflg) {
       roster_msg_setflag(winId, FALSE, TRUE);
-      update_roster = TRUE;
+      scr_update_roster();
     }
   }
 }
 
 static char *attention_sign_guard(const gchar *key, const gchar *new_value)
 {
-  update_roster = TRUE;
+  scr_update_roster();
   if (g_strcmp0(settings_opt_get(key), new_value)) {
     guint sign;
     char *c;
@@ -1795,7 +1798,7 @@
 
     // Build the buddylist at least once, to make sure the special buffer
     // is added
-    buddylist_build();
+    buddylist_defer_build();
 
     // Init prev_chatwidth; this variable will be used to prevent us
     // from rewrapping buffers when the width doesn't change.
@@ -1819,7 +1822,7 @@
   }
 
   // We'll need to redraw the roster
-  update_roster = TRUE;
+  scr_update_roster();
   return;
 }
 
@@ -2086,7 +2089,11 @@
   char space[2] = " ";
 
   // We can reset update_roster
-  update_roster = FALSE;
+  if (_update_roster == FALSE)
+    return;
+  _update_roster = FALSE;
+
+  buddylist_build();
 
   getmaxyx(rosterWnd, maxy, maxx);
   maxx--;  // Last char is for vertical border
@@ -2158,7 +2165,6 @@
     unsigned short ismsg, isgrp, ismuc, ishid, isspe;
     guint isurg;
     gchar *rline_locale;
-    GSList *resources, *p_res;
 
     bflags = buddy_getflags(BUDDATA(buddy));
     btype = buddy_gettype(BUDDATA(buddy));
@@ -2178,17 +2184,22 @@
     status = '?';
     pending = ' ';
 
-    resources = buddy_getresources(BUDDATA(buddy));
-    for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) {
-      guint events = buddy_resource_getevents(BUDDATA(buddy),
-                                              p_res ? p_res->data : "");
-      if ((events & ROSTER_EVENT_PAUSED) && pending != '+')
-        pending = '.';
-      if (events & ROSTER_EVENT_COMPOSING)
-        pending = '+';
-      g_free(p_res->data);
+    if (!ismuc) {
+      // There is currently no chat state support for MUC
+      GSList *resources = buddy_getresources(BUDDATA(buddy));
+      GSList *p_res;
+
+      for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) {
+        guint events = buddy_resource_getevents(BUDDATA(buddy),
+                                                p_res ? p_res->data : "");
+        if ((events & ROSTER_EVENT_PAUSED) && pending != '+')
+          pending = '.';
+        if (events & ROSTER_EVENT_COMPOSING)
+          pending = '+';
+        g_free(p_res->data);
+      }
+      g_slist_free(resources);
     }
-    g_slist_free(resources);
 
     // Display message notice if there is a message flag, but not
     // for unfolded groups.
@@ -2293,6 +2304,12 @@
   curs_set(cursor_backup);
 }
 
+void scr_update_roster(void)
+{
+  _update_roster = TRUE;
+}
+
+
 //  scr_roster_visibility(status)
 // Set the roster visibility:
 // status=1   Show roster
@@ -2532,10 +2549,11 @@
     // Remove the readmark if it is at the end of the buffer
     scr_buffer_readmark(-1);
   }
-  // We should rebuild the buddylist but not everytime
+  // We should rebuild the buddylist when the last selected buddy isn't
+  // displayed anymore
   if (!(buddylist_get_filter() & 1<<prev_st))
-    buddylist_build();
-  update_roster = TRUE;
+    buddylist_defer_build();
+  scr_update_roster();
 }
 
 //  scr_roster_top()
@@ -2658,7 +2676,7 @@
                                  sub_none, -1);
   // Set a lock to see it in the buddylist
   buddy_setflags(BUDDATA(roster_elt), ROSTER_FLAG_LOCK, TRUE);
-  buddylist_build();
+  buddylist_defer_build();
   // Jump to the buddy
   set_current_buddy(buddy_search_jid(barejid));
   if (chatmode) {
@@ -2695,7 +2713,7 @@
     ngroup = buddy_getgroup(unread_ptr);
     if (buddy_getflags(ngroup) & ROSTER_FLAG_HIDE) {
       buddy_setflags(ngroup, ROSTER_FLAG_HIDE, FALSE);
-      buddylist_build();
+      buddylist_defer_build();
     }
   }
 
@@ -2772,8 +2790,8 @@
       if (strchr(filter, imstatus2char[budstate]) || show_all)
         status |= 1<<budstate;
     buddylist_set_filter(status);
-    buddylist_build();
-    update_roster = TRUE;
+    buddylist_defer_build();
+    scr_update_roster();
     return;
   }
 
@@ -2961,7 +2979,7 @@
     win_entry->bd->top = NULL;
   }
 
-  update_roster = TRUE;
+  scr_update_roster();
 
   // Refresh the window
   scr_update_buddy_window();
@@ -3314,7 +3332,7 @@
   }
   if (!chatmode || !current_id || strcmp(bjid, current_id) || iscurrentlocked) 
{
     roster_msg_setflag(bjid, special, TRUE);
-    update_roster = TRUE;
+    scr_update_roster();
   }
 }
 
@@ -3351,7 +3369,7 @@
 
   if (!chatmode || !current_id || strcmp(bjid, current_id) || iscurrentlocked) 
{
     roster_setuiprio(bjid, special, value, action);
-    update_roster = TRUE;
+    scr_update_roster();
   }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/screen.h 
new/mcabber-1.0.5/mcabber/screen.h
--- old/mcabber-1.0.4/mcabber/screen.h  2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/mcabber/screen.h  2017-01-29 21:40:20.000000000 +0100
@@ -57,7 +57,6 @@
 
 int COLOR_ATTRIB[COLOR_max];
 
-extern int update_roster;
 extern gboolean chatstates_disabled;
 extern gboolean Autoaway;
 
@@ -110,6 +109,7 @@
 void scr_resize(void);
 void scr_draw_main_window(unsigned int fullinit);
 void scr_draw_roster(void);
+void scr_update_roster(void);
 void scr_update_main_status(int forceupdate);
 void scr_update_chat_status(int forceupdate);
 void scr_roster_visibility(int status);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/xmpp.c 
new/mcabber-1.0.5/mcabber/xmpp.c
--- old/mcabber-1.0.4/mcabber/xmpp.c    2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/mcabber/xmpp.c    2017-01-29 21:40:20.000000000 +0100
@@ -142,9 +142,8 @@
 
   roster_add_user(cleanjid, name, group, ROSTER_TYPE_USER, sub_pending, -1);
   g_free(cleanjid);
-  buddylist_build();
-
-  update_roster = TRUE;
+  buddylist_defer_build();
+  scr_update_roster();
 }
 
 void xmpp_updatebuddy(const char *bjid, const char *name, const char *group)
@@ -229,9 +228,9 @@
 
   roster_del_user(cleanjid);
   g_free(cleanjid);
-  buddylist_build();
+  buddylist_defer_build();
 
-  update_roster = TRUE;
+  scr_update_roster();
 }
 
 void xmpp_request(const char *fjid, enum iqreq_type reqtype)
@@ -877,7 +876,7 @@
   // Reset carbons
   carbons_reset();
   // Update display
-  update_roster = TRUE;
+  scr_update_roster();
   scr_update_buddy_window();
 
   if (!reason)
@@ -927,7 +926,7 @@
   }
 
   buddy_resource_setevents(sl_buddy->data, resource, xep85->last_state_rcvd);
-  update_roster = TRUE;
+  scr_update_roster();
 #endif
 }
 
@@ -986,8 +985,8 @@
       buddy_settype(room_elt->data, ROSTER_TYPE_ROOM);
     }
 
-    buddylist_build();
-    scr_draw_roster();
+    buddylist_defer_build();
+    scr_update_roster();
     goto gotmessage_return;
   }
 
@@ -1137,6 +1136,13 @@
     LmMessageNode *xenc;
     const char *carbon_name = x->name;
     carbons = TRUE;
+
+    // Check envelope JID for carbon messages
+    if (!jid_equal(lm_connection_get_jid(lconnection), bjid)) {
+      scr_LogPrint(LPRINT_LOGNORM, "Received invalid carbon copy from %s.", 
bjid);
+      goto handle_messages_return;
+    }
+
     // Go 1 level deeper to the forwarded message
     x = lm_message_node_find_xmlns(x, NS_FORWARD);
     if (x)
@@ -1694,7 +1700,7 @@
     /* The subscription request has been denied or a previously-granted
        subscription has been cancelled */
     roster_unsubscribed(from);
-    update_roster = TRUE;
+    scr_update_roster();
     buf = g_strdup_printf("<%s> has cancelled your subscription to "
                           "their presence updates", from);
     scr_WriteIncomingMessage(r, buf, 0, HBB_PREFIX_INFO, 0);
@@ -1706,7 +1712,7 @@
   }
 
   if (newbuddy)
-    update_roster = TRUE;
+    scr_update_roster();
   g_free(r);
   return LM_HANDLER_RESULT_REMOVE_MESSAGE;
 }
@@ -2067,7 +2073,7 @@
     // We'll have to update the roster if we switch to/from offline because
     // we don't know the presences of buddies when offline...
     if (mystatus == offline || st == offline)
-      update_roster = TRUE;
+      scr_update_roster();
 
     if (isonline || mystatus || st)
 #ifdef WITH_DEPRECATED_STATUS_INVISIBLE
@@ -2119,7 +2125,7 @@
 
 //  send_storage(store)
 // Send the node "store" to update the server.
-// Note: the sender should check we're online.
+// Note: the caller should check we're online.
 void send_storage(LmMessageNode *store)
 {
   LmMessage *iq;
@@ -2333,17 +2339,18 @@
     if (group && *group)
       lm_message_node_add_child(x, "group", group);
     changed = TRUE;
-    scr_LogPrint(LPRINT_LOGNORM, "Updating bookmarks...");
   }
 
   if (!changed)
     return;
 
-  if (xmpp_is_online())
+  if (xmpp_is_online()) {
     send_storage(bookmarks);
-  else
+    scr_LogPrint(LPRINT_LOGNORM, "Bookmarks updated.");
+  } else {
     scr_LogPrint(LPRINT_LOGNORM,
                  "Warning: you're not connected to the server.");
+  }
 }
 
 static struct annotation *parse_storage_rosternote(LmMessageNode *notenode)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/xmpp_iq.c 
new/mcabber-1.0.5/mcabber/xmpp_iq.c
--- old/mcabber-1.0.4/mcabber/xmpp_iq.c 2016-11-21 20:47:26.000000000 +0100
+++ new/mcabber-1.0.5/mcabber/xmpp_iq.c 2017-01-29 21:40:20.000000000 +0100
@@ -585,15 +585,15 @@
   const gchar *from = lm_message_get_from(m);
 
   if (from) {
-    gchar *self_bjid = jidtodisp(lm_connection_get_jid(c));
-    gchar *servername = get_servername(self_bjid, "");
-    if ((!jid_equal(self_bjid, from)) &&
+    const gchar *self_jid = lm_connection_get_jid(c);
+    gchar *servername = get_servername(self_jid, "");
+    if ((!jid_equal(self_jid, from)) &&
        (!servername || strcasecmp(from, servername))) {
       scr_LogPrint(LPRINT_LOGNORM, "Received invalid roster IQ request");
-      g_free(self_bjid);
+      g_free(servername);
       return LM_HANDLER_RESULT_REMOVE_MESSAGE;
     }
-    g_free(self_bjid);
+    g_free(servername);
   }
 
   y = lm_message_node_find_child(lm_message_node_find_xmlns(m->node, 
NS_ROSTER),
@@ -668,8 +668,8 @@
     lm_message_unref(result);
   }
 
-  buddylist_build();
-  update_roster = TRUE;
+  buddylist_defer_build();
+  scr_update_roster();
   if (need_refresh)
     scr_update_buddy_window();
   return LM_HANDLER_RESULT_REMOVE_MESSAGE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/xmpp_iqrequest.c 
new/mcabber-1.0.5/mcabber/xmpp_iqrequest.c
--- old/mcabber-1.0.4/mcabber/xmpp_iqrequest.c  2016-11-21 20:47:26.000000000 
+0100
+++ new/mcabber-1.0.5/mcabber/xmpp_iqrequest.c  2017-01-29 21:40:20.000000000 
+0100
@@ -670,8 +670,8 @@
   }
   g_free(bjid);
 
-  buddylist_build();
-  update_roster = TRUE;
+  buddylist_defer_build();
+  scr_update_roster();
 }
 
 static LmHandlerResult cb_storage_bookmarks(LmMessageHandler *h,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mcabber-1.0.4/mcabber/xmpp_muc.c 
new/mcabber-1.0.5/mcabber/xmpp_muc.c
--- old/mcabber-1.0.4/mcabber/xmpp_muc.c        2016-11-21 20:47:26.000000000 
+0100
+++ new/mcabber-1.0.5/mcabber/xmpp_muc.c        2017-01-29 21:40:20.000000000 
+0100
@@ -296,7 +296,7 @@
 }
 
 //  muc_get_item_info(...)
-// Get room member's information from xmlndata.
+// Get room member's information from xmldata.
 // The variables must be initialized before calling this function,
 // because they are not touched if the relevant information is missing.
 // Note that *actor should be freed by the caller.
@@ -494,7 +494,7 @@
     scr_WriteIncomingMessage(roomjid, msg, 0, HBB_PREFIX_INFO, 0);
     // Send back an unavailable packet
     xmpp_setstatus(offline, roomjid, "", TRUE);
-    scr_draw_roster();
+    scr_update_roster();
     return;
   }
 
@@ -627,7 +627,7 @@
       buddy_del_all_resources(room_elt->data);
       buddy_settopic(room_elt->data, NULL);
       scr_update_chat_status(FALSE);
-      update_roster = TRUE;
+      scr_update_roster();
     }
 
     // The message depends on _who_ left, and _how_
@@ -697,7 +697,7 @@
       flagjoins = buddy_getflagjoins(room_elt->data);
       if (flagjoins == flagjoins_default &&
           settings_opt_get_int("muc_flag_joins") == 2)
-       flagjoins = flagjoins_all;
+        flagjoins = flagjoins_all;
       if (!our_presence && flagjoins != flagjoins_all)
         msgflags |= HBB_PREFIX_NOFLAG;
       //silent message if someone else joins, and we care about noone
@@ -748,7 +748,7 @@
     cmd_room_whois(room_elt->data, rname, FALSE);
   }
 
-  scr_draw_roster();
+  scr_update_roster();
 }
 
 void roompresence(gpointer room, void *presencedata)


Reply via email to