Reset carbons when the connection is closed
Then, carbons are re-enabled when mcabber reconnects.
Thanks to sezuan for the report.
--- a/mcabber/mcabber/carbons.c Sun May 11 18:02:41 2014 +0200
+++ b/mcabber/mcabber/carbons.c Mon Jun 09 10:01:48 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 Sun May 11 18:02:41 2014 +0200
+++ b/mcabber/mcabber/carbons.h Mon Jun 09 10:01:48 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/xmpp.c Sun May 11 18:02:41 2014 +0200
+++ b/mcabber/mcabber/xmpp.c Mon Jun 09 10:01:48 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();