changeset 2026:564d99cdf0d1

MUC: do not destroy previous room invitation to create a new one If a previous similar mediated invitation exists, we do not remove it to create a new one (it's very confusing) unless the new one looks better, e.g. if the new invitation allows us to decline the invitation and the old one did not.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 25 Aug 2012 15:40:50 +0200
parents 33426f7fb4a9
children 107d39cd968b
files mcabber/mcabber/xmpp_muc.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_muc.c	Sat Aug 25 12:05:31 2012 +0200
+++ b/mcabber/mcabber/xmpp_muc.c	Sat Aug 25 15:40:50 2012 +0200
@@ -787,6 +787,13 @@
       iel = iel -> next;
       if (!g_strcmp0(to, invitation->to) &&
           !g_strcmp0(passwd, invitation->passwd)) {
+        // found a previous invitation
+        // We keep the old one, unless the current one is better and allows us
+        // to send a reply.
+        if (!reply || invitation->reply) {
+          g_free(barejid);
+          return;
+        }
         scr_LogPrint(LPRINT_DEBUG, "Destroying previous invitation event %s.",
                      invitation->evid);
         evs_del(invitation->evid);