[MOD] Add width/height information when possible

This commit is contained in:
LDA 2024-09-30 06:11:31 +02:00
commit d989331716
5 changed files with 103 additions and 3 deletions

23
src/include/FileInfo.h Normal file
View file

@ -0,0 +1,23 @@
#ifndef PARSEE_FILEINFO_H
#define PARSEE_FILEINFO_H
#include "XML.h"
typedef struct FileInfo {
int width;
int height;
int size;
} FileInfo;
/** Grab file metadata through SIMS.
* ----------------
* Returns: File information(SIMS)[HEAP]
* Thrasher: FileInfoFree */
extern FileInfo * FileInfoFromXMPP(XMLElement *stanza);
/** Frees all information related with file metadata.
* --------------
* Thrashes: info */
extern void FileInfoFree(FileInfo *info);
#endif

View file

@ -3,6 +3,8 @@
#include <Cytoplasm/Json.h>
#include "FileInfo.h"
/* A simple representation of everything. It is not as complex as
* Telodendria's CommonID parser, simply because Parsee does not
* need such complexity. */
@ -33,7 +35,7 @@ extern HashMap * MatrixCreateReact(char *event, char *body);
extern HashMap * MatrixCreateReplace(char *event, char *body);
/* Creates the content for a media file. */
extern HashMap * MatrixCreateMedia(char *mxc, char *body, char *mime);
extern HashMap * MatrixCreateMedia(char *mxc, char *body, char *mime, FileInfo *info);
/* Creates the content for a m.room.name state event */
extern HashMap * MatrixCreateNameState(char *name);