mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:15:11 +00:00
[ADD/WIP] Start adding reactions
This commit is contained in:
parent
de1ee3986e
commit
1126497d5b
7 changed files with 93 additions and 6 deletions
22
src/Events.c
22
src/Events.c
|
|
@ -157,3 +157,25 @@ MatrixCreateReplace(char *event, char *body)
|
|||
|
||||
return map;
|
||||
}
|
||||
HashMap *
|
||||
MatrixCreateReact(char *event, char *body)
|
||||
{
|
||||
HashMap *map;
|
||||
HashMap *rel;
|
||||
if (!body || !event)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
map = HashMapCreate();
|
||||
|
||||
rel = HashMapCreate();
|
||||
HashMapSet(rel, "rel_type", JsonValueString("m.annotation"));
|
||||
HashMapSet(rel, "event_id", JsonValueString(event));
|
||||
HashMapSet(rel, "key", JsonValueString(body));
|
||||
|
||||
HashMapSet(map, "m.relates_to", JsonValueObject(rel));
|
||||
|
||||
return map;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue