mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 19:55:10 +00:00
[ADD/WIP] Baisic VCards, worst XEP-0393 parser
Blocks coming soon. Took me a day to get a system I remotely liked, and now I feel ashamed of that a bit. It's truly over...
This commit is contained in:
parent
c349b37f60
commit
4007232716
6 changed files with 409 additions and 12 deletions
14
src/Events.c
14
src/Events.c
|
|
@ -3,6 +3,8 @@
|
|||
#include <Cytoplasm/Memory.h>
|
||||
#include <Cytoplasm/Str.h>
|
||||
|
||||
#include <XEP393.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
HashMap *
|
||||
|
|
@ -25,6 +27,7 @@ HashMap *
|
|||
MatrixCreateMessage(char *body)
|
||||
{
|
||||
HashMap *map;
|
||||
char *text = NULL;
|
||||
if (!body)
|
||||
{
|
||||
return NULL;
|
||||
|
|
@ -33,6 +36,17 @@ MatrixCreateMessage(char *body)
|
|||
map = HashMapCreate();
|
||||
HashMapSet(map, "msgtype", JsonValueString("m.text"));
|
||||
HashMapSet(map, "body", JsonValueString(body));
|
||||
{
|
||||
/* TODO */
|
||||
XEP393Element *e = XEP393(body);
|
||||
text = XEP393ToXMLString(e);
|
||||
XEP393FreeElement(e);
|
||||
|
||||
|
||||
HashMapSet(map, "formatted_body", JsonValueString(text));
|
||||
HashMapSet(map, "format", JsonValueString("org.matrix.custom.html"));
|
||||
Free(text);
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue