[ADD/WIP/AYA] Sending errors, voice reqs, Ayawork.

Ayaya!
This commit is contained in:
LDA 2024-08-05 19:45:57 +02:00
commit 8588a6fb5c
7 changed files with 197 additions and 5 deletions

View file

@ -79,6 +79,7 @@ PresenceStanza(ParseeData *args, XMLElement *stanza)
char *decode_from, *real_matrix;
char *matrix_user_pl = ParseeEncodeJID(args->config, trim, false);
char *affiliation = HashMapGet(item->attrs, "affiliation");
char *role = HashMapGet(item->attrs, "role");
int power_level = 0;
char *parsee = ParseeMXID(args);
@ -117,6 +118,24 @@ PresenceStanza(ParseeData *args, XMLElement *stanza)
power_level = -1;
}
if (StrEquals(role, "visitor"))
{
char *parsee = ParseeJID(args);
if (!StrEquals(HashMapGet(stanza->attrs, "to"), parsee) &&
IsStatus(110))
{
char *muc = ParseeTrimJID(HashMapGet(stanza->attrs, "from"));
char *usr = HashMapGet(stanza->attrs, "to");
/* Ask for voice */
XMPPRequestVoice(args->jabber, usr, muc);
Free(muc);
}
Free(parsee);
}
/* Set the user's PL
* TODO: Do NOT change the PL of *real* people nilly-willy.
* In some scenarios, this is really bad behaviour. */