changeset 2128:adcff2d51ecb

Merge shizeeg's branch with main
author Mikael Berthe <mikael@lilotux.net>
date Tue, 24 Jun 2014 19:10:57 +0200
parents 3b26f3a58cb9 (diff) 5d6838f40736 (current diff)
children 32f1bbf5917e
files mcabber/mcabber/commands.c
diffstat 5 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/carbons.c	Thu May 15 02:58:13 2014 +0000
+++ b/mcabber/mcabber/carbons.c	Tue Jun 24 19:10:57 2014 +0200
@@ -80,6 +80,12 @@
   lm_message_unref(iq);
 }
 
+// Mark carbons as disabled (e.g. when a connection terminates)
+void carbons_reset()
+{
+  _carbons_enabled = 0;
+}
+
 void carbons_disable()
 {
   LmMessage *iq;
--- a/mcabber/mcabber/carbons.h	Thu May 15 02:58:13 2014 +0000
+++ b/mcabber/mcabber/carbons.h	Tue Jun 24 19:10:57 2014 +0200
@@ -5,5 +5,6 @@
 void carbons_enable();
 void carbons_disable();
 void carbons_info();
+void carbons_reset();
 
 #endif //__MCABBER_CARBONS_H__
--- a/mcabber/mcabber/commands.c	Thu May 15 02:58:13 2014 +0000
+++ b/mcabber/mcabber/commands.c	Tue Jun 24 19:10:57 2014 +0200
@@ -2126,10 +2126,10 @@
     }
     g_free(p_res->data);
   }
-  
+
   snprintf(buffer, 4095, "Total: %d", cnt);
   scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0);
-  
+
   g_slist_free(resources);
   g_free(buffer);
 }
@@ -2937,7 +2937,7 @@
     arg = NULL;
 
   arg = to_utf8(arg);
-  // if arg is not NULL & option is set, unescape it 
+  // If arg is not NULL & option is set, unescape it
   if (arg) {
     char *unescaped_topic = NULL;
 
@@ -2948,7 +2948,7 @@
       arg = tmp;
       unescaped_topic = ut_unescape_tabs_cr(arg);
     }
-    
+
     // We must not free() if the original string was returned
     if (unescaped_topic == arg)
       unescaped_topic = NULL;
--- a/mcabber/mcabber/utils.c	Thu May 15 02:58:13 2014 +0000
+++ b/mcabber/mcabber/utils.c	Tue Jun 24 19:10:57 2014 +0200
@@ -589,13 +589,17 @@
     if (*p == '"') {
       if (!escape) {
         instring = !instring;
-        strcpy(p, p+1);
+        //memmove(p, p+1, strlen(p));
+        for (char *t=p; *t; t++)
+          *t = *(t+1);
         p--;
       } else
         escape = FALSE;
     } else if (*p == '\\') {
       if (!escape) {
-        strcpy(p, p+1);
+        //memmove(p, p+1, strlen(p));
+        for (char *t=p; *t; t++)
+          *t = *(t+1);
         p--;
       }
       escape = !escape;
--- a/mcabber/mcabber/xmpp.c	Thu May 15 02:58:13 2014 +0000
+++ b/mcabber/mcabber/xmpp.c	Tue Jun 24 19:10:57 2014 +0200
@@ -40,6 +40,7 @@
 #include "settings.h"
 #include "utils.h"
 #include "main.h"
+#include "carbons.h"
 
 #define RECONNECTION_TIMEOUT    60L
 
@@ -952,6 +953,8 @@
   if (rosternotes)
     lm_message_node_unref(rosternotes);
   rosternotes = NULL;
+  // Reset carbons
+  carbons_reset();
   // Update display
   update_roster = TRUE;
   scr_update_buddy_window();