mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 13:45:10 +00:00
[FIX] Somewhat fix semianon avatars
This commit is contained in:
parent
308dfd500d
commit
a4b8141f4a
1 changed files with 9 additions and 15 deletions
|
|
@ -802,7 +802,6 @@ IQGenerateQuery(void)
|
|||
} \
|
||||
while (0);
|
||||
|
||||
/* TODO: Advertise more things */
|
||||
IQ_ADVERT
|
||||
#undef AdvertiseSimple
|
||||
}
|
||||
|
|
@ -953,15 +952,7 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
if (vcard)
|
||||
{
|
||||
XMLElement *photo = XMLookForUnique(vcard, "PHOTO");
|
||||
XMLElement *nickname = XMLookForUnique(vcard, "NICKNAME");
|
||||
|
||||
if (nickname)
|
||||
{
|
||||
XMLElement *data = ArrayGet(nickname->children, 0);
|
||||
/* TODO: Use the nickname for something.
|
||||
* And the rest of the vCard, somewhere. */
|
||||
(void) data;
|
||||
}
|
||||
if (photo)
|
||||
{
|
||||
XMLElement *binval = XMLookForUnique(photo, "BINVAL");
|
||||
|
|
@ -974,7 +965,8 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
size_t length, b64len;
|
||||
Stream *datastream;
|
||||
char *mxc = NULL, *from_matrix = NULL, *jid = NULL;
|
||||
char *room = NULL;
|
||||
char *room = NULL, *resource;
|
||||
char *from = HashMapGet(stanza->attrs, "from");
|
||||
if (!data || !data->data)
|
||||
{
|
||||
Log(LOG_ERR, "%s NOT FOUND", HashMapGet(stanza->attrs, "from"));
|
||||
|
|
@ -1000,17 +992,18 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
|
||||
room = ParseeGetBridgedRoom(args, stanza);
|
||||
jid = ParseeLookupJID(HashMapGet(stanza->attrs, "from"));
|
||||
if (jid && !StrEquals(jid, HashMapGet(stanza->attrs, "from")))
|
||||
|
||||
resource = ParseeTrimJID(from);
|
||||
|
||||
/* TODO: More reliable system for telling the difference appart */
|
||||
if (jid && !StrEquals(from, resource))
|
||||
{
|
||||
from_matrix = ParseeEncodeJID(args->config, jid, false);
|
||||
ASSetAvatar(args->config, from_matrix, mxc);
|
||||
}
|
||||
else if (room)
|
||||
{
|
||||
char *mask = StrConcat(4,
|
||||
"@", args->config->sender_localpart,
|
||||
":", args->config->homeserver_host
|
||||
);
|
||||
char *mask = ParseeMXID(args);
|
||||
HashMap *obj = HashMapCreate();
|
||||
|
||||
HashMapSet(obj, "url", JsonValueString(mxc));
|
||||
|
|
@ -1023,6 +1016,7 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
}
|
||||
|
||||
Free(from_matrix);
|
||||
Free(resource);
|
||||
Free(room);
|
||||
Free(jid);
|
||||
Free(mxc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue