1. User A and B join a MUC
2. Both A and B write something
3. A leaves the MUC, while B doesn't
4. C joins the MUC and receive the backlog
The right behaviour would be to show the backlog with what both A and B wrote.
The actual behaviour is that in the MUC C receives what B said and not what A said.
The messages that A sent appear as a normal text channel coming directly from the conference room (like if the conference room was a normal user writing C something) or sometimes they are not received at all.
Here's a failing test case: http://git.collabora.co.uk/?p=user/wjt/telepathy-gabble-wjt.git;a=shortlog;h=refs/heads/fd.o-27913-broken-muc-scrollback
AFAICT MUC scrollback is previously entirely untested, which is pretty cool. But this test passes for scrollback from ourself and another current MUC member. It only fails when we hit the scrollback message from someone not in the MUC:
This is a WockyMuc bug. In wocky-muc.c, handle_message():
who = g_hash_table_lookup (priv->members, from);
if (who == NULL)
/* not another member, is it from 'ourselves'? */
gchar *from_jid = wocky_normalise_jid (from);
/* is it from us? fake up a member struct */
if (g_str_equal (from_jid, priv->jid))
from_self = TRUE;
DEBUG ("Message received from unknown MUC member %s.", from_jid);
The else block is wrong.
I fixed this, because I was looking at the MUC code anyway while fixing things for bug 27964.
The branch refactors the function which handles MUC messages a bunch to be a bit clearer, and fixes some stuff that was mis-translated from the Gabble code. Unfortunately it added 24 lines of code. I consider this a personal failure.
Merged courtesy of review by Sjoerd! The snapshot in gabble 0.9.12 will include this fix.