mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 19:55:10 +00:00
[ADD/WIP] Editing support XMPP->Matrix
This commit is contained in:
parent
771c3271ad
commit
ae740878c8
13 changed files with 249 additions and 106 deletions
28
src/Events.c
28
src/Events.c
|
|
@ -129,3 +129,31 @@ MatrixGetReply(HashMap *event)
|
|||
"event_id")
|
||||
));
|
||||
}
|
||||
HashMap *
|
||||
MatrixCreateReplace(char *event, char *body)
|
||||
{
|
||||
HashMap *map;
|
||||
HashMap *new;
|
||||
HashMap *rel;
|
||||
if (!body || !event)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
map = HashMapCreate();
|
||||
HashMapSet(map, "msgtype", JsonValueString("m.text"));
|
||||
HashMapSet(map, "body", JsonValueString(body));
|
||||
|
||||
new = HashMapCreate();
|
||||
HashMapSet(new, "msgtype", JsonValueString("m.text"));
|
||||
HashMapSet(new, "body", JsonValueString(body));
|
||||
|
||||
rel = HashMapCreate();
|
||||
HashMapSet(rel, "rel_type", JsonValueString("m.replace"));
|
||||
HashMapSet(rel, "event_id", JsonValueString(event));
|
||||
|
||||
HashMapSet(map, "m.new_content", JsonValueObject(new));
|
||||
HashMapSet(map, "m.relates_to", JsonValueObject(rel));
|
||||
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue