Xonotic
command.qc File Reference
#include "command.qh"
#include <common/command/_mod.qh>
+ Include dependency graph for command.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 GENERIC_COMMAND (mx, "Send a matrix command", false)
 

Function Documentation

◆ GENERIC_COMMAND()

GENERIC_COMMAND ( mx  ,
"Send a matrix command"  ,
false   
)

Definition at line 5 of file command.qc.

References argv(), argv_start_index, matrix_access_token, matrix_room, matrix_user, MX_Forget(), MX_Join(), MX_Leave(), MX_Messages(), MX_Nick(), MX_Say(), MX_Sync(), MX_Typing(), strcpy, string_null, strunzone(), strzone(), and substring().

5  {
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
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
+ Here is the call graph for this function: