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.
--- 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);