mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:35:10 +00:00
[FIX] Fix broken chatstates
This commit is contained in:
parent
74f3fbdccc
commit
88bd2d27ad
3 changed files with 7 additions and 14 deletions
|
|
@ -66,27 +66,24 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
|
||||
PEPManagerHandle(thr->info->pep_manager, stanza);
|
||||
|
||||
/* TODO: Separate the chatstate processing code. */
|
||||
#define CHAT_STATES "http://jabber.org/protocol/chatstates"
|
||||
if (XMLookForTKV(stanza, "composing", "xmlns", CHAT_STATES))
|
||||
{
|
||||
decode_from = ParseeLookupJID(from);
|
||||
from_matrix = ParseeEncodeJID(args->config, decode_from, true);
|
||||
from_matrix = ParseeGetBridgedUser(args, stanza);
|
||||
mroom_id = ParseeGetBridgedRoom(args, stanza);
|
||||
|
||||
ASType(args->config, from_matrix, mroom_id, true);
|
||||
|
||||
Free(decode_from);
|
||||
Free(from_matrix);
|
||||
Free(mroom_id);
|
||||
mroom_id = NULL;
|
||||
decode_from = NULL;
|
||||
from_matrix = NULL;
|
||||
}
|
||||
if (XMLookForTKV(stanza, "active", "xmlns", CHAT_STATES))
|
||||
{
|
||||
char *latest = NULL;
|
||||
decode_from = ParseeLookupJID(from);
|
||||
from_matrix = ParseeEncodeJID(args->config, decode_from, true);
|
||||
from_matrix = ParseeGetBridgedUser(args, stanza);
|
||||
mroom_id = ParseeGetBridgedRoom(args, stanza);
|
||||
|
||||
latest = ParseeLookupHead(mroom_id);
|
||||
|
|
@ -94,12 +91,10 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
ASType(args->config, from_matrix, mroom_id, false);
|
||||
ASPresence(args->config, from_matrix, mroom_id, latest);
|
||||
|
||||
Free(decode_from);
|
||||
Free(from_matrix);
|
||||
Free(latest);
|
||||
Free(mroom_id);
|
||||
mroom_id = NULL;
|
||||
decode_from = NULL;
|
||||
from_matrix = NULL;
|
||||
}
|
||||
if (XMLookForTKV(stanza, "paused", "xmlns", CHAT_STATES) ||
|
||||
|
|
@ -108,20 +103,17 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
{
|
||||
/* TODO: Use stanza ID if possible */
|
||||
char *latest = NULL;
|
||||
decode_from = ParseeLookupJID(from);
|
||||
from_matrix = ParseeEncodeJID(args->config, decode_from, true);
|
||||
from_matrix = ParseeGetBridgedUser(args, stanza);
|
||||
mroom_id = ParseeGetBridgedRoom(args, stanza);
|
||||
|
||||
latest = ParseeLookupHead(mroom_id);
|
||||
|
||||
ASPresence(args->config, from_matrix, mroom_id, latest);
|
||||
|
||||
Free(decode_from);
|
||||
Free(from_matrix);
|
||||
Free(latest);
|
||||
Free(mroom_id);
|
||||
mroom_id = NULL;
|
||||
decode_from = NULL;
|
||||
from_matrix = NULL;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue