mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 17:05:11 +00:00
[ADD] External URL for media events
This commit is contained in:
parent
43b3f8aaf5
commit
517622a4ac
1 changed files with 18 additions and 9 deletions
|
|
@ -576,17 +576,26 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
char *mxc, *mime = NULL;
|
||||
HashMap *content = NULL;
|
||||
oob_data = XMLookForUnique(oob, "url");
|
||||
oob_data = ArrayGet(oob_data->children, 0);
|
||||
oob_data =
|
||||
oob_data ? ArrayGet(oob_data->children, 0) : NULL;
|
||||
|
||||
mxc = ASReupload(args->config, oob_data->data, &mime);
|
||||
content = MatrixCreateMedia(mxc, data->data, mime);
|
||||
if (oob_data)
|
||||
{
|
||||
mxc = ASReupload(args->config, oob_data->data, &mime);
|
||||
content = MatrixCreateMedia(mxc, data->data, mime);
|
||||
|
||||
event_id = ASSend(
|
||||
args->config, mroom_id, encoded,
|
||||
"m.room.message", content
|
||||
);
|
||||
Free(mime);
|
||||
Free(mxc);
|
||||
/* Yeah, no, I'm not modifying the media creation code. */
|
||||
HashMapSet(content, "external_url",
|
||||
JsonValueString(oob_data->data)
|
||||
);
|
||||
|
||||
event_id = ASSend(
|
||||
args->config, mroom_id, encoded,
|
||||
"m.room.message", content
|
||||
);
|
||||
Free(mime);
|
||||
Free(mxc);
|
||||
}
|
||||
}
|
||||
else if (reactions)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue