[FIX] Leaves now actually do matter on Matrix

This commit is contained in:
LDA 2024-09-07 18:37:45 +02:00
commit 53739dd42d
4 changed files with 46 additions and 1 deletions

View file

@ -13,6 +13,9 @@
#include <ctype.h>
static const char *
GetXMPPInformation(ParseeData *data, HashMap *event, char **from, char **to);
static void
JoinMUC(ParseeData *data, HashMap *event, char *jid, char *muc, char *name)
{
@ -121,6 +124,21 @@ ParseeMemberHandler(ParseeData *data, HashMap *event)
muc_id = ParseeGetMUCID(data, chat_id);
if (!chat_id)
{
/* If it can't be found, try to see if it's as a DM */
char *info_from = NULL, *info_to = NULL;
const char *type = GetXMPPInformation(data, event, &info_from, &info_to);
if (StrEquals(type, "chat"))
{
char *jid_to = ParseeTrimJID(info_to);
Log(LOG_DEBUG, "('%s'->'%s') is gone.", state_key, info_to);
/* TODO: Send a last DM, signifying that all is gone. */
ParseeDeleteDM(data, state_key, jid_to);
Free(jid_to);
}
Free(info_from);
Free(info_to);
goto end;
}