mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-14 00:45:10 +00:00
[MOD] Make vcard-avatars XEP-0421 tier
This commit is contained in:
parent
f743a33643
commit
db10a70313
6 changed files with 89 additions and 4 deletions
|
|
@ -5,6 +5,8 @@
|
|||
#include <Cytoplasm/Log.h>
|
||||
#include <Cytoplasm/Sha.h>
|
||||
|
||||
#include <Parsee.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
char *
|
||||
|
|
@ -193,7 +195,7 @@ char *
|
|||
ParseeGetBridgedUserI(ParseeData *data, XMLElement *stanza, char *force)
|
||||
{
|
||||
char *user, *xmpp_from, *type;
|
||||
char *decode_from, *occ_id = NULL;
|
||||
char *decode_from, *occ_id = NULL, *looked = NULL;
|
||||
bool is_chat, has_anon = false, is_anon = false;
|
||||
|
||||
if (!data || !stanza)
|
||||
|
|
@ -209,10 +211,10 @@ ParseeGetBridgedUserI(ParseeData *data, XMLElement *stanza, char *force)
|
|||
if (!is_chat)
|
||||
{
|
||||
has_anon = ServerHasXEP421(data, xmpp_from);
|
||||
is_anon = has_anon && StrEquals(xmpp_from, decode_from);
|
||||
is_anon = has_anon;// && StrEquals(xmpp_from, decode_from);
|
||||
}
|
||||
|
||||
if (is_anon)
|
||||
if (is_anon || force)
|
||||
{
|
||||
XMLElement *occupant;
|
||||
occupant = XMLookForTKV(
|
||||
|
|
@ -220,6 +222,15 @@ ParseeGetBridgedUserI(ParseeData *data, XMLElement *stanza, char *force)
|
|||
"xmlns", "urn:xmpp:occupant-id:0"
|
||||
);
|
||||
occ_id = occupant ? HashMapGet(occupant->attrs, "id") : NULL;
|
||||
if (!occ_id)
|
||||
{
|
||||
occ_id = ParseeLookupOID(xmpp_from);
|
||||
looked = occ_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
ParseePushOIDTable(xmpp_from, occ_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!occ_id)
|
||||
|
|
@ -230,9 +241,11 @@ ParseeGetBridgedUserI(ParseeData *data, XMLElement *stanza, char *force)
|
|||
type ? is_chat : false
|
||||
);
|
||||
Free(decode_from);
|
||||
Free(looked);
|
||||
return user;
|
||||
}
|
||||
|
||||
Free(decode_from);
|
||||
Free(looked);
|
||||
return ScrambleOID(data, occ_id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue