Xonotic
command.qc
Go to the documentation of this file.
1 #include "command.qh"
2 
3 #include <common/command/_mod.qh>
4 
5 GENERIC_COMMAND(mx, "Send a matrix command", false) {
6  switch (argv(1)) {
7  case "user":
8  strcpy(matrix_user, substring(command, argv_start_index(2), -1));
9  break;
10  case "token":
12  break;
13  case "messages":
15  break;
16  case "nick":
17  MX_Nick(substring(command, argv_start_index(2), -1));
18  break;
19  case "join":
20  string s = substring(command, argv_start_index(2), -1);
21  if (s != matrix_room && matrix_room != "") {
24  }
25  matrix_room = strzone(s);
27  break;
28  case "sync":
30  break;
31  case "typing":
32  MX_Typing(true);
33  break;
34  case "say":
35  MX_Say(substring(command, argv_start_index(2), -1));
36  break;
37  case "leave":
40  break;
41  case "forget":
43  matrix_room = "";
44  break;
45  }
46 }
string string_null
Definition: nil.qh:9
string matrix_access_token
Definition: matrix.qh:5
GENERIC_COMMAND(mx, "Send a matrix command", false)
Definition: command.qc:5
void MX_Typing(bool state)
Definition: matrix.qc:159
string matrix_room
Definition: matrix.qh:6
#define strcpy(this, s)
Definition: string.qh:49
void MX_Join(string room)
Definition: matrix.qc:115
void MX_Nick(string name)
Definition: matrix.qc:6
#define argv_start_index
Definition: dpextensions.qh:27
void MX_Say(string body)
Definition: matrix.qc:187
void MX_Leave(string room)
Definition: matrix.qc:125
string matrix_user
Definition: matrix.qh:4
void MX_Messages(string from)
Definition: matrix.qc:34
void MX_Forget(string room)
Definition: matrix.qc:135
void MX_Sync(string since)
Definition: matrix.qc:70