23 fh.url_content_type =
"application/json";
24 url_fputs(fh, sprintf(
"{\"displayname\": \"%s\"}", pass.message));
59 for (
int i = 0, n =
stof(
json_get(buf,
"chunk.length")); i < n; ++i) {
78 sprintf(
"filter={\"account_data\":{\"types\":[]},\"presence\":{\"types\":[]},\"room\":{\"rooms\":[\"%s\"]}}&",
matrix_room)
83 "filter={\"account_data\":{\"types\":[]},\"presence\":{\"types\":[]},\"room\":{\"rooms\":[]}}&" 103 string arr = sprintf(
"rooms.join.%s.timeline.events",
matrix_room);
104 for (
int i = 0, n =
stof(
json_get(buf, sprintf(
"%s.length", arr))); i < n; ++i) {
105 MX_Handle(buf, sprintf(
"%s.%d", arr, i));
149 fh.url_content_type =
"application/json";
150 url_fputs(fh, sprintf(
"{%s}", pass.message));
163 pass.message = state ?
"true" :
"false";
176 fh.url_content_type =
"application/json";
177 url_fputs(fh, sprintf(
"{\"typing\": %s, \"timeout\": 30000}", pass.message));
205 fh.url_content_type =
"application/json";
206 url_fputs(fh, sprintf(
"{\"msgtype\": \"m.text\", \"body\": \"%s\"}", pass.message));
const float URL_READY_CANREAD
void MX_Sync_(entity fh, entity pass, int status)
const float URL_READY_CLOSED
ERASEABLE int json_parse(string in, bool() func)
const float URL_READY_CANWRITE
string matrix_access_token
void MX_Typing(bool state)
#define EXPECT_NE(val1, val2)
void MX_Join(string room)
void MX_Nick(string name)
ERASEABLE string json_get(int buf, string key)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
ERASEABLE void url_fputs(entity e, string s)
ERASEABLE void url_fclose(entity e)
void MX_Leave(string room)
void MX_Typing_(entity fh, entity pass, int status)
void MX_Messages(string from)
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
bool _json_parse_object()
parse a json object
void MX_Forget(string room)
void MX_Sync(string since)
void MX_JLF_(entity fh, entity pass, int status)
#define new_pure(class)
purely logical entities (.origin doesn't work)
void MX_Nick_(entity fh, entity pass, int status)
#define pass(name, colormin, colormax)
void MX_Messages_(entity fh, entity pass, int status)
void MX_Say_(entity fh, entity pass, int status)
ERASEABLE string url_fgets(entity e)
string autocvar_matrix_server