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";
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));
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define pass(name, colormin, colormax)
ERASEABLE int json_parse(string in, bool() func)
ERASEABLE string json_get(int buf, string key)
bool _json_parse_object()
parse a json object
void MX_JLF_(entity fh, entity pass, int status)
void MX_Typing_(entity fh, entity pass, int status)
void MX_Nick(string name)
void MX_Messages_(entity fh, entity pass, int status)
void MX_Say_(entity fh, entity pass, int status)
void MX_Nick_(entity fh, entity pass, int status)
void MX_Leave(string room)
void MX_Messages(string from)
void MX_Sync_(entity fh, entity pass, int status)
void MX_Sync(string since)
void MX_Forget(string room)
void MX_Typing(bool state)
void MX_Join(string room)
string matrix_access_token
string autocvar_matrix_server
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define new_pure(class)
purely logical entities (not linked to the area grid)
#define EXPECT_NE(val1, val2)
ERASEABLE string url_fgets(entity e)
ERASEABLE void url_fputs(entity e, string s)
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
ERASEABLE void url_fclose(entity e)
const float URL_READY_CLOSED
const float URL_READY_CANREAD
const float URL_READY_CANWRITE