From a77eb8feabe9ca8ddebcafc81c2fef981387d3da Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 24 Feb 2017 02:26:20 -0300 Subject: Handle new style topic/groupchat membership events Looks like the mercury topics were deprecated and instead we get these: * deltaThreadName * deltaParticipantsAddedToGroupThread * deltaParticipantLeftGroupThread Also slightly modified the handlers on the bitlbee side to add users directly without requiring a thread fetch, and to show a kick message --- facebook/facebook.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'facebook/facebook.c') diff --git a/facebook/facebook.c b/facebook/facebook.c index 29a67e9..995ad59 100644 --- a/facebook/facebook.c +++ b/facebook/facebook.c @@ -353,15 +353,21 @@ fb_cb_api_events(FbApi *api, GSList *events, gpointer data) case FB_API_EVENT_TYPE_THREAD_USER_ADDED: if (bee_user_by_handle(ic->bee, ic, uid) == NULL) { - g_hash_table_insert(fetch, &event->tid, event); - break; + if (event->text) { + bee_user_new(ic->bee, ic, uid, BEE_USER_LOCAL); + imcb_buddy_nick_hint(ic, uid, event->text); + imcb_rename_buddy(ic, uid, event->text); + } else { + g_hash_table_insert(fetch, &event->tid, event); + break; + } } imcb_chat_add_buddy(gc, uid); break; case FB_API_EVENT_TYPE_THREAD_USER_REMOVED: - imcb_chat_remove_buddy(gc, uid, NULL); + imcb_chat_remove_buddy(gc, uid, event->text); break; } } -- cgit v1.2.3