mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 16:45:10 +00:00
[MOD] Die on loopback stanza
Dirty hack to a memory problem.
This commit is contained in:
parent
b408cbf224
commit
14ebef53ce
7 changed files with 77 additions and 16 deletions
|
|
@ -35,6 +35,14 @@ ParseeXMPPThread(void *argp)
|
|||
if (StrEquals(stanza->name, "message"))
|
||||
{
|
||||
size_t i;
|
||||
if (StrEquals(HashMapGet(stanza->attrs, "from"),
|
||||
HashMapGet(stanza->attrs, "to")))
|
||||
{
|
||||
/* There's not a lot of scenarios where we loopback */
|
||||
Log(LOG_INFO, "Dropping thread...");
|
||||
XMLFreeElement(stanza);
|
||||
break;
|
||||
}
|
||||
for (i = 0; i < ArraySize(stanza->children); i++)
|
||||
{
|
||||
XMLElement *child = ArrayGet(stanza->children, i);
|
||||
|
|
@ -55,11 +63,10 @@ ParseeXMPPThread(void *argp)
|
|||
room = ParseeFindDMRoom(args, to, from);
|
||||
data = ArrayGet(body->children, 0);
|
||||
|
||||
/* TODO: Manage that out. $[to] corresponds to a Matrix
|
||||
* user, which we need to find the */
|
||||
/* TODO: Consider having rich messages */
|
||||
ASSend(
|
||||
args->config, room, from_matrix,
|
||||
"m.room.message", MatrixCreateNotice(data->data)
|
||||
"m.room.message", MatrixCreateMessage(data->data)
|
||||
);
|
||||
Free(from_matrix);
|
||||
Free(room);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue