[ADD/WIP] One-way chatstates, capabilities

No avatarwerk today because avatars are an absolute sore.
This commit is contained in:
LDA 2024-07-02 02:21:31 +02:00
commit 6b0f08c49e
10 changed files with 349 additions and 24 deletions

View file

@ -175,6 +175,7 @@ XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc)
XMLAddAttr(x, "xmlns", "http://jabber.org/protocol/muc");
XMLAddChild(presence, x);
XMPPAnnotatePresence(presence);
XMLEncode(comp->stream, presence);
StreamFlush(comp->stream);
@ -279,3 +280,23 @@ XMPPGetReply(XMLElement *elem)
return HashMapGet(rep->attrs, "id");
}
void
XMPPAnnotatePresence(XMLElement *presence)
{
XMLElement *c;
char *ver;
if (!presence)
{
return;
}
ver = XMPPGenerateVer();
c = XMLCreateTag("c");
XMLAddAttr(c, "xmlns", "http://jabber.org/protocol/caps");
XMLAddAttr(c, "hash", "sha-1");
XMLAddAttr(c, "node", REPOSITORY);
XMLAddAttr(c, "ver", ver);
Free(ver);
XMLAddChild(presence, c);
}