[ADD/WIP] VCard4, slightly more PEPwerk

This commit is contained in:
LDA 2024-07-22 18:02:24 +02:00
commit ee004ca9c0
10 changed files with 313 additions and 32 deletions

View file

@ -120,6 +120,8 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
{
XMLElement *vcard = XMLookForTKV(stanza, "vCard", "xmlns", "vcard-temp");
/* TODO: Move this to PEP */
XMLElement *event = XMLookForTKV(stanza, "pubsub",
"xmlns", "http://jabber.org/protocol/pubsub"
);
@ -425,10 +427,15 @@ IQSet(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
}
#undef DISCO
void IQStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
void
IQStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
{
char *type;
type = HashMapGet(stanza->attrs, "type");
char *type = HashMapGet(stanza->attrs, "type");
if (PEPManagerHandle(thr->info->pep_manager, stanza))
{
return;
}
#define OnType(ctyp, callback) do \
{ \
if (StrEquals(type, #ctyp)) \

View file

@ -17,7 +17,6 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
XMLElement *reactions = NULL;
XMLElement *body = NULL;
XMLElement *data = NULL;
XMLElement *event = NULL;
char *to, *room, *from, *from_matrix, *decode_from;
char *mroom_id = NULL;
@ -64,25 +63,7 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
}
body = XMLookForUnique(stanza, "body");
event = XMLookForTKV(stanza, "event",
"xmlns", "http://jabber.org/protocol/pubsub#event"
);
if (event)
{
size_t i;
XMLElement *items =
XMLookForTKV(event, "items", "node", "urn:xmpp:avatar:metadata");
if (items)
{
for (i = 0; i < ArraySize(items->children); i++)
{
ManageProfileItem(
args, ArrayGet(items->children, i),
stanza, thr
);
}
}
}
PEPManagerHandle(thr->info->pep_manager, stanza);
#define CHAT_STATES "http://jabber.org/protocol/chatstates"
if (XMLookForTKV(stanza, "composing", "xmlns", CHAT_STATES))