Added sub commands to command structure
This commit is contained in:
@@ -132,6 +132,11 @@ GHashTable *commands = NULL;
|
|||||||
#define CMD_TAG_UI "ui"
|
#define CMD_TAG_UI "ui"
|
||||||
#define CMD_TAG_PLUGINS "plugins"
|
#define CMD_TAG_PLUGINS "plugins"
|
||||||
|
|
||||||
|
#define CMD_MAINFUNC(func) func,
|
||||||
|
#define CMD_NOMAINFUNC NULL,
|
||||||
|
#define CMD_SUBFUNCS(...) { __VA_ARGS__, { NULL, NULL } },
|
||||||
|
#define CMD_NOSUBFUNCS { { NULL, NULL } },
|
||||||
|
|
||||||
#define CMD_NOTAGS { { NULL },
|
#define CMD_NOTAGS { { NULL },
|
||||||
#define CMD_TAGS(...) { { __VA_ARGS__, NULL },
|
#define CMD_TAGS(...) { { __VA_ARGS__, NULL },
|
||||||
#define CMD_SYN(...) { __VA_ARGS__, NULL },
|
#define CMD_SYN(...) { __VA_ARGS__, NULL },
|
||||||
@@ -147,7 +152,9 @@ GHashTable *commands = NULL;
|
|||||||
static struct cmd_t command_defs[] =
|
static struct cmd_t command_defs[] =
|
||||||
{
|
{
|
||||||
{ "/help",
|
{ "/help",
|
||||||
cmd_help, parse_args, 0, 2, NULL,
|
parse_args, 0, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_help)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/help [<area>|<command>]")
|
"/help [<area>|<command>]")
|
||||||
@@ -168,7 +175,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/about",
|
{ "/about",
|
||||||
cmd_about, parse_args, 0, 0, NULL,
|
parse_args, 0, 0, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_about)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/about")
|
"/about")
|
||||||
@@ -179,7 +188,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/connect",
|
{ "/connect",
|
||||||
cmd_connect, parse_args, 0, 7, NULL,
|
parse_args, 0, 7, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_connect)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION)
|
CMD_TAG_CONNECTION)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -206,7 +217,15 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/tls",
|
{ "/tls",
|
||||||
cmd_tls, parse_args, 1, 3, NULL,
|
parse_args, 1, 3, NULL,
|
||||||
|
CMD_SUBFUNCS(
|
||||||
|
{ "certpath", cmd_tls_certpath },
|
||||||
|
{ "trust", cmd_tls_trust },
|
||||||
|
{ "trusted", cmd_tls_trusted },
|
||||||
|
{ "revoke", cmd_tls_revoke },
|
||||||
|
{ "show", cmd_tls_show },
|
||||||
|
{ "cert", cmd_tls_cert })
|
||||||
|
CMD_NOMAINFUNC
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION,
|
CMD_TAG_CONNECTION,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -241,7 +260,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/disconnect",
|
{ "/disconnect",
|
||||||
cmd_disconnect, parse_args, 0, 0, NULL,
|
parse_args, 0, 0, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_disconnect)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION)
|
CMD_TAG_CONNECTION)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -253,7 +274,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/msg",
|
{ "/msg",
|
||||||
cmd_msg, parse_args_with_freetext, 1, 2, NULL,
|
parse_args_with_freetext, 1, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_msg)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -276,7 +299,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/roster",
|
{ "/roster",
|
||||||
cmd_roster, parse_args_with_freetext, 0, 4, NULL,
|
parse_args_with_freetext, 0, 4, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_roster)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_ROSTER,
|
CMD_TAG_ROSTER,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -394,7 +419,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/group",
|
{ "/group",
|
||||||
cmd_group, parse_args_with_freetext, 0, 3, NULL,
|
parse_args_with_freetext, 0, 3, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_group)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_ROSTER,
|
CMD_TAG_ROSTER,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -419,7 +446,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/info",
|
{ "/info",
|
||||||
cmd_info, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_info)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_ROSTER,
|
CMD_TAG_ROSTER,
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
@@ -440,7 +469,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/caps",
|
{ "/caps",
|
||||||
cmd_caps, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_caps)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_DISCOVERY,
|
CMD_TAG_DISCOVERY,
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
@@ -461,7 +492,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/software",
|
{ "/software",
|
||||||
cmd_software, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_software)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_DISCOVERY,
|
CMD_TAG_DISCOVERY,
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
@@ -483,7 +516,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/status",
|
{ "/status",
|
||||||
cmd_status, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_status)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
@@ -502,7 +537,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/resource",
|
{ "/resource",
|
||||||
cmd_resource, parse_args, 1, 2, &cons_resource_setting,
|
parse_args, 1, 2, &cons_resource_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_resource)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -522,7 +559,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/join",
|
{ "/join",
|
||||||
cmd_join, parse_args, 0, 5, NULL,
|
parse_args, 0, 5, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_join)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -547,7 +586,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/leave",
|
{ "/leave",
|
||||||
cmd_leave, parse_args, 0, 0, NULL,
|
parse_args, 0, 0, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_leave)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -559,7 +600,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/invite",
|
{ "/invite",
|
||||||
cmd_invite, parse_args_with_freetext, 1, 2, NULL,
|
parse_args_with_freetext, 1, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_invite)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -573,7 +616,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/invites",
|
{ "/invites",
|
||||||
cmd_invites, parse_args_with_freetext, 0, 0, NULL,
|
parse_args_with_freetext, 0, 0, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_invites)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -585,7 +630,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/decline",
|
{ "/decline",
|
||||||
cmd_decline, parse_args_with_freetext, 1, 1, NULL,
|
parse_args_with_freetext, 1, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_decline)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -598,7 +645,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/room",
|
{ "/room",
|
||||||
cmd_room, parse_args, 1, 1, NULL,
|
parse_args, 1, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_room)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -613,7 +662,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/kick",
|
{ "/kick",
|
||||||
cmd_kick, parse_args_with_freetext, 1, 2, NULL,
|
parse_args_with_freetext, 1, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_kick)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -627,7 +678,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/ban",
|
{ "/ban",
|
||||||
cmd_ban, parse_args_with_freetext, 1, 2, NULL,
|
parse_args_with_freetext, 1, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_ban)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -641,7 +694,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/subject",
|
{ "/subject",
|
||||||
cmd_subject, parse_args_with_freetext, 0, 2, NULL,
|
parse_args_with_freetext, 0, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_subject)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -662,7 +717,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/affiliation",
|
{ "/affiliation",
|
||||||
cmd_affiliation, parse_args_with_freetext, 1, 4, NULL,
|
parse_args_with_freetext, 1, 4, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_affiliation)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -678,7 +735,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/role",
|
{ "/role",
|
||||||
cmd_role, parse_args_with_freetext, 1, 4, NULL,
|
parse_args_with_freetext, 1, 4, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_role)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -694,7 +753,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/occupants",
|
{ "/occupants",
|
||||||
cmd_occupants, parse_args, 1, 3, cons_occupants_setting,
|
parse_args, 1, 3, cons_occupants_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_occupants)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT,
|
CMD_TAG_GROUPCHAT,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -716,7 +777,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/form",
|
{ "/form",
|
||||||
cmd_form, parse_args, 1, 2, NULL,
|
parse_args, 1, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_form)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -735,7 +798,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/rooms",
|
{ "/rooms",
|
||||||
cmd_rooms, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_rooms)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -750,7 +815,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/bookmark",
|
{ "/bookmark",
|
||||||
cmd_bookmark, parse_args, 0, 8, NULL,
|
parse_args, 0, 8, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_bookmark)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -776,7 +843,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/disco",
|
{ "/disco",
|
||||||
cmd_disco, parse_args, 1, 2, NULL,
|
parse_args, 1, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_disco)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_DISCOVERY)
|
CMD_TAG_DISCOVERY)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -796,7 +865,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/lastactivity",
|
{ "/lastactivity",
|
||||||
cmd_lastactivity, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_lastactivity)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_PRESENCE)
|
CMD_TAG_PRESENCE)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -816,7 +887,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/nick",
|
{ "/nick",
|
||||||
cmd_nick, parse_args_with_freetext, 1, 1, NULL,
|
parse_args_with_freetext, 1, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_nick)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -829,7 +902,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/win",
|
{ "/win",
|
||||||
cmd_win, parse_args, 1, 1, NULL,
|
parse_args, 1, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_win)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -860,7 +935,14 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/wins",
|
{ "/wins",
|
||||||
cmd_wins, parse_args, 0, 3, NULL,
|
parse_args, 0, 3, NULL,
|
||||||
|
CMD_SUBFUNCS(
|
||||||
|
{ "unread", cmd_wins_unread },
|
||||||
|
{ "tidy", cmd_wins_tidy },
|
||||||
|
{ "prune", cmd_wins_prune },
|
||||||
|
{ "swap", cmd_wins_swap },
|
||||||
|
{ "autotidy", cmd_wins_autotidy })
|
||||||
|
CMD_MAINFUNC(cmd_wins)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -883,7 +965,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/sub",
|
{ "/sub",
|
||||||
cmd_sub, parse_args, 1, 2, NULL,
|
parse_args, 1, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_sub)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_ROSTER)
|
CMD_TAG_ROSTER)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -911,7 +995,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/tiny",
|
{ "/tiny",
|
||||||
cmd_tiny, parse_args, 1, 1, NULL,
|
parse_args, 1, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_tiny)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
@@ -926,7 +1012,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/who",
|
{ "/who",
|
||||||
cmd_who, parse_args, 0, 2, NULL,
|
parse_args, 0, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_who)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
CMD_TAG_GROUPCHAT,
|
CMD_TAG_GROUPCHAT,
|
||||||
@@ -957,7 +1045,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/close",
|
{ "/close",
|
||||||
cmd_close, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_close)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -985,7 +1075,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/clear",
|
{ "/clear",
|
||||||
cmd_clear, parse_args, 0, 0, NULL,
|
parse_args, 0, 0, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_clear)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -997,7 +1089,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/quit",
|
{ "/quit",
|
||||||
cmd_quit, parse_args, 0, 0, NULL,
|
parse_args, 0, 0, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_quit)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/quit")
|
"/quit")
|
||||||
@@ -1008,7 +1102,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/privileges",
|
{ "/privileges",
|
||||||
cmd_privileges, parse_args, 1, 1, &cons_privileges_setting,
|
parse_args, 1, 1, &cons_privileges_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_privileges)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT,
|
CMD_TAG_GROUPCHAT,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -1022,7 +1118,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/charset",
|
{ "/charset",
|
||||||
cmd_charset, parse_args, 0, 0, NULL,
|
parse_args, 0, 0, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_charset)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1034,7 +1132,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/beep",
|
{ "/beep",
|
||||||
cmd_beep, parse_args, 1, 1, &cons_beep_setting,
|
parse_args, 1, 1, &cons_beep_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_beep)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1049,7 +1149,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/console",
|
{ "/console",
|
||||||
cmd_console, parse_args, 2, 2, &cons_console_setting,
|
parse_args, 2, 2, &cons_console_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_console)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI,
|
CMD_TAG_UI,
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
@@ -1075,7 +1177,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/encwarn",
|
{ "/encwarn",
|
||||||
cmd_encwarn, parse_args, 1, 1, &cons_encwarn_setting,
|
parse_args, 1, 1, &cons_encwarn_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_encwarn)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -1089,7 +1193,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/presence",
|
{ "/presence",
|
||||||
cmd_presence, parse_args, 1, 1, &cons_presence_setting,
|
parse_args, 1, 1, &cons_presence_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_presence)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI,
|
CMD_TAG_UI,
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
@@ -1103,7 +1209,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/wrap",
|
{ "/wrap",
|
||||||
cmd_wrap, parse_args, 1, 1, &cons_wrap_setting,
|
parse_args, 1, 1, &cons_wrap_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_wrap)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1116,7 +1224,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/time",
|
{ "/time",
|
||||||
cmd_time, parse_args, 1, 3, &cons_time_setting,
|
parse_args, 1, 3, &cons_time_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_time)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1156,7 +1266,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/inpblock",
|
{ "/inpblock",
|
||||||
cmd_inpblock, parse_args, 2, 2, &cons_inpblock_setting,
|
parse_args, 2, 2, &cons_inpblock_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_inpblock)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1171,7 +1283,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/notify",
|
{ "/notify",
|
||||||
cmd_notify, parse_args_with_freetext, 0, 4, NULL,
|
parse_args_with_freetext, 0, 4, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_notify)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI,
|
CMD_TAG_UI,
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
@@ -1240,7 +1354,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/flash",
|
{ "/flash",
|
||||||
cmd_flash, parse_args, 1, 1, &cons_flash_setting,
|
parse_args, 1, 1, &cons_flash_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_flash)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1254,7 +1370,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/tray",
|
{ "/tray",
|
||||||
cmd_tray, parse_args, 1, 1, &cons_tray_setting,
|
parse_args, 1, 1, &cons_tray_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_tray)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1267,7 +1385,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/intype",
|
{ "/intype",
|
||||||
cmd_intype, parse_args, 1, 1, &cons_intype_setting,
|
parse_args, 1, 1, &cons_intype_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_intype)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI,
|
CMD_TAG_UI,
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
@@ -1281,7 +1401,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/splash",
|
{ "/splash",
|
||||||
cmd_splash, parse_args, 1, 1, &cons_splash_setting,
|
parse_args, 1, 1, &cons_splash_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_splash)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1294,7 +1416,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/autoconnect",
|
{ "/autoconnect",
|
||||||
cmd_autoconnect, parse_args, 1, 2, &cons_autoconnect_setting,
|
parse_args, 1, 2, &cons_autoconnect_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_autoconnect)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION)
|
CMD_TAG_CONNECTION)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1312,7 +1436,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/vercheck",
|
{ "/vercheck",
|
||||||
cmd_vercheck, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_vercheck)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1325,7 +1451,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/titlebar",
|
{ "/titlebar",
|
||||||
cmd_titlebar, parse_args, 2, 2, &cons_titlebar_setting,
|
parse_args, 2, 2, &cons_titlebar_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_titlebar)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1340,7 +1468,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/alias",
|
{ "/alias",
|
||||||
cmd_alias, parse_args_with_freetext, 1, 3, NULL,
|
parse_args_with_freetext, 1, 3, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_alias)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/alias list",
|
"/alias list",
|
||||||
@@ -1361,7 +1491,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/chlog",
|
{ "/chlog",
|
||||||
cmd_chlog, parse_args, 1, 1, &cons_chlog_setting,
|
parse_args, 1, 1, &cons_chlog_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_chlog)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1377,7 +1509,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/grlog",
|
{ "/grlog",
|
||||||
cmd_grlog, parse_args, 1, 1, &cons_grlog_setting,
|
parse_args, 1, 1, &cons_grlog_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_grlog)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_GROUPCHAT)
|
CMD_TAG_GROUPCHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1391,7 +1525,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/states",
|
{ "/states",
|
||||||
cmd_states, parse_args, 1, 1, &cons_states_setting,
|
parse_args, 1, 1, &cons_states_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_states)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1404,7 +1540,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/pgp",
|
{ "/pgp",
|
||||||
cmd_pgp, parse_args, 1, 3, NULL,
|
parse_args, 1, 3, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_pgp)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -1439,7 +1577,23 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/otr",
|
{ "/otr",
|
||||||
cmd_otr, parse_args, 1, 3, NULL,
|
parse_args, 1, 3, NULL,
|
||||||
|
CMD_SUBFUNCS(
|
||||||
|
{ "char", cmd_otr_char },
|
||||||
|
{ "log", cmd_otr_log },
|
||||||
|
{ "libver", cmd_otr_libver },
|
||||||
|
{ "policy", cmd_otr_policy },
|
||||||
|
{ "gen", cmd_otr_gen },
|
||||||
|
{ "myfp", cmd_otr_myfp },
|
||||||
|
{ "theirfp", cmd_otr_theirfp },
|
||||||
|
{ "start", cmd_otr_start },
|
||||||
|
{ "end", cmd_otr_end },
|
||||||
|
{ "trust", cmd_otr_trust },
|
||||||
|
{ "untrust", cmd_otr_untrust },
|
||||||
|
{ "secret", cmd_otr_secret },
|
||||||
|
{ "question", cmd_otr_question },
|
||||||
|
{ "answer", cmd_otr_answer })
|
||||||
|
CMD_NOMAINFUNC
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
@@ -1492,7 +1646,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/outtype",
|
{ "/outtype",
|
||||||
cmd_outtype, parse_args, 1, 1, &cons_outtype_setting,
|
parse_args, 1, 1, &cons_outtype_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_outtype)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1505,7 +1661,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/gone",
|
{ "/gone",
|
||||||
cmd_gone, parse_args, 1, 1, &cons_gone_setting,
|
parse_args, 1, 1, &cons_gone_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_gone)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1519,7 +1677,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/history",
|
{ "/history",
|
||||||
cmd_history, parse_args, 1, 1, &cons_history_setting,
|
parse_args, 1, 1, &cons_history_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_history)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI,
|
CMD_TAG_UI,
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
@@ -1534,7 +1694,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/log",
|
{ "/log",
|
||||||
cmd_log, parse_args, 1, 2, &cons_log_setting,
|
parse_args, 1, 2, &cons_log_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_log)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/log where",
|
"/log where",
|
||||||
@@ -1552,7 +1714,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/carbons",
|
{ "/carbons",
|
||||||
cmd_carbons, parse_args, 1, 1, &cons_carbons_setting,
|
parse_args, 1, 1, &cons_carbons_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_carbons)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1566,7 +1730,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/receipts",
|
{ "/receipts",
|
||||||
cmd_receipts, parse_args, 2, 2, &cons_receipts_setting,
|
parse_args, 2, 2, &cons_receipts_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_receipts)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CHAT)
|
CMD_TAG_CHAT)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1581,7 +1747,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/reconnect",
|
{ "/reconnect",
|
||||||
cmd_reconnect, parse_args, 1, 1, &cons_reconnect_setting,
|
parse_args, 1, 1, &cons_reconnect_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_reconnect)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION)
|
CMD_TAG_CONNECTION)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1594,7 +1762,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/autoping",
|
{ "/autoping",
|
||||||
cmd_autoping, parse_args, 2, 2, &cons_autoping_setting,
|
parse_args, 2, 2, &cons_autoping_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_autoping)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION)
|
CMD_TAG_CONNECTION)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1609,7 +1779,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/ping",
|
{ "/ping",
|
||||||
cmd_ping, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_ping)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION)
|
CMD_TAG_CONNECTION)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1623,7 +1795,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/autoaway",
|
{ "/autoaway",
|
||||||
cmd_autoaway, parse_args_with_freetext, 2, 3, &cons_autoaway_setting,
|
parse_args_with_freetext, 2, 3, &cons_autoaway_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_autoaway)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_PRESENCE)
|
CMD_TAG_PRESENCE)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1654,7 +1828,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/priority",
|
{ "/priority",
|
||||||
cmd_priority, parse_args, 1, 1, NULL,
|
parse_args, 1, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_priority)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_PRESENCE)
|
CMD_TAG_PRESENCE)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1668,7 +1844,19 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/account",
|
{ "/account",
|
||||||
cmd_account, parse_args, 0, 4, NULL,
|
parse_args, 0, 4, NULL,
|
||||||
|
CMD_SUBFUNCS(
|
||||||
|
{ "list", cmd_account_list },
|
||||||
|
{ "show", cmd_account_show },
|
||||||
|
{ "add", cmd_account_add },
|
||||||
|
{ "remove", cmd_account_remove },
|
||||||
|
{ "enable", cmd_account_enable },
|
||||||
|
{ "disable", cmd_account_disable },
|
||||||
|
{ "rename", cmd_account_rename },
|
||||||
|
{ "default", cmd_account_default },
|
||||||
|
{ "set", cmd_account_set },
|
||||||
|
{ "clear", cmd_account_clear })
|
||||||
|
CMD_MAINFUNC(cmd_account)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION
|
CMD_TAG_CONNECTION
|
||||||
CMD_TAG_PRESENCE,
|
CMD_TAG_PRESENCE,
|
||||||
@@ -1759,7 +1947,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/plugins",
|
{ "/plugins",
|
||||||
cmd_plugins, parse_args, 0, 2, NULL,
|
parse_args, 0, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_plugins)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/plugins",
|
"/plugins",
|
||||||
@@ -1773,7 +1963,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/prefs",
|
{ "/prefs",
|
||||||
cmd_prefs, parse_args, 0, 1, NULL,
|
parse_args, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_prefs)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/prefs [ui|desktop|chat|log|conn|presence|otr|pgp]")
|
"/prefs [ui|desktop|chat|log|conn|presence|otr|pgp]")
|
||||||
@@ -1793,7 +1985,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/theme",
|
{ "/theme",
|
||||||
cmd_theme, parse_args, 1, 2, &cons_theme_setting,
|
parse_args, 1, 2, &cons_theme_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_theme)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1814,7 +2008,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/statuses",
|
{ "/statuses",
|
||||||
cmd_statuses, parse_args, 2, 2, &cons_statuses_setting,
|
parse_args, 2, 2, &cons_statuses_setting,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_statuses)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI,
|
CMD_TAG_UI,
|
||||||
CMD_TAG_CHAT,
|
CMD_TAG_CHAT,
|
||||||
@@ -1838,7 +2034,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/xmlconsole",
|
{ "/xmlconsole",
|
||||||
cmd_xmlconsole, parse_args, 0, 0, NULL,
|
parse_args, 0, 0, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_xmlconsole)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_UI)
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1850,7 +2048,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/away",
|
{ "/away",
|
||||||
cmd_away, parse_args_with_freetext, 0, 1, NULL,
|
parse_args_with_freetext, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_away)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_PRESENCE)
|
CMD_TAG_PRESENCE)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1865,7 +2065,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/chat",
|
{ "/chat",
|
||||||
cmd_chat, parse_args_with_freetext, 0, 1, NULL,
|
parse_args_with_freetext, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_chat)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_PRESENCE)
|
CMD_TAG_PRESENCE)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1880,7 +2082,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/dnd",
|
{ "/dnd",
|
||||||
cmd_dnd, parse_args_with_freetext, 0, 1, NULL,
|
parse_args_with_freetext, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_dnd)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_PRESENCE)
|
CMD_TAG_PRESENCE)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1895,7 +2099,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/online",
|
{ "/online",
|
||||||
cmd_online, parse_args_with_freetext, 0, 1, NULL,
|
parse_args_with_freetext, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_online)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_PRESENCE)
|
CMD_TAG_PRESENCE)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1910,7 +2116,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/xa",
|
{ "/xa",
|
||||||
cmd_xa, parse_args_with_freetext, 0, 1, NULL,
|
parse_args_with_freetext, 0, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_xa)
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_PRESENCE)
|
CMD_TAG_PRESENCE)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
@@ -1925,7 +2133,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/script",
|
{ "/script",
|
||||||
cmd_script, parse_args, 1, 2, NULL,
|
parse_args, 1, 2, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_script)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/script run <script>",
|
"/script run <script>",
|
||||||
@@ -1945,7 +2155,9 @@ static struct cmd_t command_defs[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ "/export",
|
{ "/export",
|
||||||
cmd_export, parse_args, 1, 1, NULL,
|
parse_args, 1, 1, NULL,
|
||||||
|
CMD_NOSUBFUNCS
|
||||||
|
CMD_MAINFUNC(cmd_export)
|
||||||
CMD_NOTAGS
|
CMD_NOTAGS
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/export <filepath>")
|
"/export <filepath>")
|
||||||
@@ -3047,11 +3259,26 @@ _cmd_execute(ProfWin *window, const char *const command, const char *const inp)
|
|||||||
if (result == FALSE) {
|
if (result == FALSE) {
|
||||||
ui_invalid_command_usage(cmd->cmd, cmd->setting_func);
|
ui_invalid_command_usage(cmd->cmd, cmd->setting_func);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
}
|
||||||
gboolean result = cmd->func(window, command, args);
|
if (args[0] && cmd->sub_funcs) {
|
||||||
|
int i = 0;
|
||||||
|
while (cmd->sub_funcs[i][0]) {
|
||||||
|
if (g_strcmp0(args[0], (char*)cmd->sub_funcs[i][0]) == 0) {
|
||||||
|
gboolean (*func)(ProfWin *window, const char *const command, gchar **args) = cmd->sub_funcs[i][1];
|
||||||
|
gboolean result = func(window, command, args);
|
||||||
g_strfreev(args);
|
g_strfreev(args);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!cmd->func) {
|
||||||
|
ui_invalid_command_usage(cmd->cmd, cmd->setting_func);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
gboolean result = cmd->func(window, command, args);
|
||||||
|
g_strfreev(args);
|
||||||
|
return result;
|
||||||
} else if (plugins_run_command(inp)) {
|
} else if (plugins_run_command(inp)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -180,9 +180,8 @@ cmd_execute_alias(ProfWin *window, const char *const inp, gboolean *ran)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cmd_tls(ProfWin *window, const char *const command, gchar **args)
|
cmd_tls_certpath(ProfWin *window, const char *const command, gchar **args)
|
||||||
{
|
{
|
||||||
if (g_strcmp0(args[0], "certpath") == 0) {
|
|
||||||
#ifdef HAVE_LIBMESODE
|
#ifdef HAVE_LIBMESODE
|
||||||
if (g_strcmp0(args[1], "set") == 0) {
|
if (g_strcmp0(args[1], "set") == 0) {
|
||||||
if (args[2] == NULL) {
|
if (args[2] == NULL) {
|
||||||
@@ -218,7 +217,12 @@ cmd_tls(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("Certificate path setting only supported when built with libmesode.");
|
cons_show("Certificate path setting only supported when built with libmesode.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
} else if (g_strcmp0(args[0], "trust") == 0) {
|
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_tls_trust(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
#ifdef HAVE_LIBMESODE
|
||||||
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
||||||
if (conn_status != JABBER_CONNECTED) {
|
if (conn_status != JABBER_CONNECTED) {
|
||||||
@@ -247,7 +251,11 @@ cmd_tls(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("Manual certificate trust only supported when built with libmesode.");
|
cons_show("Manual certificate trust only supported when built with libmesode.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
} else if (g_strcmp0(args[0], "trusted") == 0) {
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_tls_trusted(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
#ifdef HAVE_LIBMESODE
|
||||||
GList *certs = tlscerts_list();
|
GList *certs = tlscerts_list();
|
||||||
GList *curr = certs;
|
GList *curr = certs;
|
||||||
@@ -270,7 +278,11 @@ cmd_tls(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("Manual certificate trust only supported when built with libmesode.");
|
cons_show("Manual certificate trust only supported when built with libmesode.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
} else if (g_strcmp0(args[0], "revoke") == 0) {
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_tls_revoke(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
#ifdef HAVE_LIBMESODE
|
||||||
if (args[1] == NULL) {
|
if (args[1] == NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
@@ -287,10 +299,18 @@ cmd_tls(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("Manual certificate trust only supported when built with libmesode.");
|
cons_show("Manual certificate trust only supported when built with libmesode.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
} else if (g_strcmp0(args[0], "show") == 0) {
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_tls_show(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
_cmd_set_boolean_preference(args[1], command, "TLS titlebar indicator", PREF_TLS_SHOW);
|
_cmd_set_boolean_preference(args[1], command, "TLS titlebar indicator", PREF_TLS_SHOW);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else if (g_strcmp0(args[0], "cert") == 0) {
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_tls_cert(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
#ifdef HAVE_LIBMESODE
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
TLSCertificate *cert = tlscerts_get_trusted(args[1]);
|
TLSCertificate *cert = tlscerts_get_trusted(args[1]);
|
||||||
@@ -325,10 +345,6 @@ cmd_tls(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("Certificate fetching not supported.");
|
cons_show("Certificate fetching not supported.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
|
||||||
cons_bad_cmd_usage(command);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -446,27 +462,24 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cmd_account(ProfWin *window, const char *const command, gchar **args)
|
cmd_account_list(ProfWin *window, const char *const command, gchar **args)
|
||||||
{
|
{
|
||||||
char *subcmd = args[0];
|
|
||||||
|
|
||||||
if (subcmd == NULL) {
|
|
||||||
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
|
||||||
cons_bad_cmd_usage(command);
|
|
||||||
} else {
|
|
||||||
ProfAccount *account = accounts_get_account(jabber_get_account_name());
|
|
||||||
cons_show_account(account);
|
|
||||||
account_free(account);
|
|
||||||
}
|
|
||||||
} else if (strcmp(subcmd, "list") == 0) {
|
|
||||||
gchar **accounts = accounts_get_list();
|
gchar **accounts = accounts_get_list();
|
||||||
cons_show_account_list(accounts);
|
cons_show_account_list(accounts);
|
||||||
g_strfreev(accounts);
|
g_strfreev(accounts);
|
||||||
} else if (strcmp(subcmd, "show") == 0) {
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account_show(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
char *account_name = args[1];
|
char *account_name = args[1];
|
||||||
if (account_name == NULL) {
|
if (account_name == NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
ProfAccount *account = accounts_get_account(account_name);
|
ProfAccount *account = accounts_get_account(account_name);
|
||||||
if (account == NULL) {
|
if (account == NULL) {
|
||||||
cons_show("No such account.");
|
cons_show("No such account.");
|
||||||
@@ -475,21 +488,35 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show_account(account);
|
cons_show_account(account);
|
||||||
account_free(account);
|
account_free(account);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (strcmp(subcmd, "add") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account_add(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
char *account_name = args[1];
|
char *account_name = args[1];
|
||||||
if (account_name == NULL) {
|
if (account_name == NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
accounts_add(account_name, NULL, 0, NULL);
|
accounts_add(account_name, NULL, 0, NULL);
|
||||||
cons_show("Account created.");
|
cons_show("Account created.");
|
||||||
cons_show("");
|
cons_show("");
|
||||||
}
|
|
||||||
} else if (strcmp(subcmd, "remove") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account_remove(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
char *account_name = args[1];
|
char *account_name = args[1];
|
||||||
if(!account_name) {
|
if(!account_name) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
char *def = prefs_get_string(PREF_DEFAULT_ACCOUNT);
|
char *def = prefs_get_string(PREF_DEFAULT_ACCOUNT);
|
||||||
if(accounts_remove(account_name)){
|
if(accounts_remove(account_name)){
|
||||||
cons_show("Account %s removed.", account_name);
|
cons_show("Account %s removed.", account_name);
|
||||||
@@ -503,12 +530,19 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
}
|
}
|
||||||
cons_show("");
|
cons_show("");
|
||||||
g_free(def);
|
g_free(def);
|
||||||
}
|
|
||||||
} else if (strcmp(subcmd, "enable") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account_enable(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
char *account_name = args[1];
|
char *account_name = args[1];
|
||||||
if (account_name == NULL) {
|
if (account_name == NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (accounts_enable(account_name)) {
|
if (accounts_enable(account_name)) {
|
||||||
cons_show("Account enabled.");
|
cons_show("Account enabled.");
|
||||||
cons_show("");
|
cons_show("");
|
||||||
@@ -516,12 +550,18 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("No such account: %s", account_name);
|
cons_show("No such account: %s", account_name);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (strcmp(subcmd, "disable") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
gboolean
|
||||||
|
cmd_account_disable(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
char *account_name = args[1];
|
char *account_name = args[1];
|
||||||
if (account_name == NULL) {
|
if (account_name == NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (accounts_disable(account_name)) {
|
if (accounts_disable(account_name)) {
|
||||||
cons_show("Account disabled.");
|
cons_show("Account disabled.");
|
||||||
cons_show("");
|
cons_show("");
|
||||||
@@ -529,11 +569,18 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("No such account: %s", account_name);
|
cons_show("No such account: %s", account_name);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (strcmp(subcmd, "rename") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account_rename(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
if (g_strv_length(args) != 3) {
|
if (g_strv_length(args) != 3) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
char *account_name = args[1];
|
char *account_name = args[1];
|
||||||
char *new_name = args[2];
|
char *new_name = args[2];
|
||||||
|
|
||||||
@@ -544,27 +591,31 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("Either account %s doesn't exist, or account %s already exists.", account_name, new_name);
|
cons_show("Either account %s doesn't exist, or account %s already exists.", account_name, new_name);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (strcmp(subcmd, "default") == 0) {
|
|
||||||
if(g_strv_length(args) == 1){
|
|
||||||
char *def = prefs_get_string(PREF_DEFAULT_ACCOUNT);
|
|
||||||
|
|
||||||
if(def){
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account_default(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
if (g_strv_length(args) == 1) {
|
||||||
|
char *def = prefs_get_string(PREF_DEFAULT_ACCOUNT);
|
||||||
|
if (def) {
|
||||||
cons_show("The default account is %s.", def);
|
cons_show("The default account is %s.", def);
|
||||||
free(def);
|
free(def);
|
||||||
} else {
|
} else {
|
||||||
cons_show("No default account.");
|
cons_show("No default account.");
|
||||||
}
|
}
|
||||||
} else if(g_strv_length(args) == 2){
|
} else if (g_strv_length(args) == 2) {
|
||||||
if(strcmp(args[1], "off") == 0){
|
if (strcmp(args[1], "off") == 0) {
|
||||||
prefs_set_string(PREF_DEFAULT_ACCOUNT, NULL);
|
prefs_set_string(PREF_DEFAULT_ACCOUNT, NULL);
|
||||||
cons_show("Removed default account.");
|
cons_show("Removed default account.");
|
||||||
} else {
|
} else {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
}
|
}
|
||||||
} else if(g_strv_length(args) == 3) {
|
} else if (g_strv_length(args) == 3) {
|
||||||
if(strcmp(args[1], "set") == 0){
|
if (strcmp(args[1], "set") == 0) {
|
||||||
if(accounts_get_account(args[2])){
|
if (accounts_get_account(args[2])) {
|
||||||
prefs_set_string(PREF_DEFAULT_ACCOUNT, args[2]);
|
prefs_set_string(PREF_DEFAULT_ACCOUNT, args[2]);
|
||||||
cons_show("Default account set to %s.", args[2]);
|
cons_show("Default account set to %s.", args[2]);
|
||||||
} else {
|
} else {
|
||||||
@@ -576,10 +627,18 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
} else {
|
} else {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
}
|
}
|
||||||
} else if (strcmp(subcmd, "set") == 0) {
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account_set(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
if (g_strv_length(args) != 4) {
|
if (g_strv_length(args) != 4) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
char *account_name = args[1];
|
char *account_name = args[1];
|
||||||
char *property = args[2];
|
char *property = args[2];
|
||||||
char *value = args[3];
|
char *value = args[3];
|
||||||
@@ -587,7 +646,9 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
if (!accounts_account_exists(account_name)) {
|
if (!accounts_account_exists(account_name)) {
|
||||||
cons_show("Account %s doesn't exist", account_name);
|
cons_show("Account %s doesn't exist", account_name);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp(property, "jid") == 0) {
|
if (strcmp(property, "jid") == 0) {
|
||||||
Jid *jid = jid_create(args[3]);
|
Jid *jid = jid_create(args[3]);
|
||||||
if (jid == NULL) {
|
if (jid == NULL) {
|
||||||
@@ -754,7 +815,6 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
if (conn_status == JABBER_CONNECTED) {
|
if (conn_status == JABBER_CONNECTED) {
|
||||||
char *connected_account = jabber_get_account_name();
|
char *connected_account = jabber_get_account_name();
|
||||||
resource_presence_t last_presence = accounts_get_last_presence(connected_account);
|
resource_presence_t last_presence = accounts_get_last_presence(connected_account);
|
||||||
|
|
||||||
if (presence_type == last_presence) {
|
if (presence_type == last_presence) {
|
||||||
char *message = jabber_get_presence_message();
|
char *message = jabber_get_presence_message();
|
||||||
cl_ev_presence_send(last_presence, message, 0);
|
cl_ev_presence_send(last_presence, message, 0);
|
||||||
@@ -770,19 +830,26 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("Invalid property: %s", property);
|
cons_show("Invalid property: %s", property);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
return TRUE;
|
||||||
} else if (strcmp(subcmd, "clear") == 0) {
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account_clear(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
if (g_strv_length(args) != 3) {
|
if (g_strv_length(args) != 3) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
char *account_name = args[1];
|
}
|
||||||
char *property = args[2];
|
|
||||||
|
|
||||||
|
char *account_name = args[1];
|
||||||
if (!accounts_account_exists(account_name)) {
|
if (!accounts_account_exists(account_name)) {
|
||||||
cons_show("Account %s doesn't exist", account_name);
|
cons_show("Account %s doesn't exist", account_name);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *property = args[2];
|
||||||
if (strcmp(property, "password") == 0) {
|
if (strcmp(property, "password") == 0) {
|
||||||
accounts_clear_password(account_name);
|
accounts_clear_password(account_name);
|
||||||
cons_show("Removed password for account %s", account_name);
|
cons_show("Removed password for account %s", account_name);
|
||||||
@@ -819,13 +886,28 @@ cmd_account(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("Invalid property: %s", property);
|
cons_show("Invalid property: %s", property);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
return TRUE;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_account(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
if (args[0] != NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_bad_cmd_usage(command);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProfAccount *account = accounts_get_account(jabber_get_account_name());
|
||||||
|
cons_show_account(account);
|
||||||
|
account_free(account);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1078,24 +1160,38 @@ cmd_quit(ProfWin *window, const char *const command, gchar **args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cmd_wins(ProfWin *window, const char *const command, gchar **args)
|
cmd_wins_unread(ProfWin *window, const char *const command, gchar **args)
|
||||||
{
|
{
|
||||||
if (args[0] == NULL) {
|
|
||||||
cons_show_wins(FALSE);
|
|
||||||
} else if (strcmp(args[0], "unread") == 0) {
|
|
||||||
cons_show_wins(TRUE);
|
cons_show_wins(TRUE);
|
||||||
} else if (strcmp(args[0], "tidy") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_wins_tidy(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
if (wins_tidy()) {
|
if (wins_tidy()) {
|
||||||
cons_show("Windows tidied.");
|
cons_show("Windows tidied.");
|
||||||
} else {
|
} else {
|
||||||
cons_show("No tidy needed.");
|
cons_show("No tidy needed.");
|
||||||
}
|
}
|
||||||
} else if (strcmp(args[0], "prune") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_wins_prune(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
ui_prune_wins();
|
ui_prune_wins();
|
||||||
} else if (strcmp(args[0], "swap") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_wins_swap(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
if ((args[1] == NULL) || (args[2] == NULL)) {
|
if ((args[1] == NULL) || (args[2] == NULL)) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
int source_win = atoi(args[1]);
|
int source_win = atoi(args[1]);
|
||||||
int target_win = atoi(args[2]);
|
int target_win = atoi(args[2]);
|
||||||
if ((source_win == 1) || (target_win == 1)) {
|
if ((source_win == 1) || (target_win == 1)) {
|
||||||
@@ -1112,8 +1208,13 @@ cmd_wins(ProfWin *window, const char *const command, gchar **args)
|
|||||||
} else {
|
} else {
|
||||||
cons_show("Same source and target window supplied.");
|
cons_show("Same source and target window supplied.");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (strcmp(args[0], "autotidy") == 0) {
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_wins_autotidy(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
if (g_strcmp0(args[1], "on") == 0) {
|
if (g_strcmp0(args[1], "on") == 0) {
|
||||||
cons_show("Window autotidy enabled");
|
cons_show("Window autotidy enabled");
|
||||||
prefs_set_boolean(PREF_WINS_AUTO_TIDY, TRUE);
|
prefs_set_boolean(PREF_WINS_AUTO_TIDY, TRUE);
|
||||||
@@ -1124,10 +1225,19 @@ cmd_wins(ProfWin *window, const char *const command, gchar **args)
|
|||||||
} else {
|
} else {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_wins(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
if (args[0] != NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cons_show_wins(FALSE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5964,15 +6074,9 @@ cmd_pgp(ProfWin *window, const char *const command, gchar **args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
cmd_otr_char(ProfWin *window, const char *const command, gchar **args)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBOTR
|
#ifdef HAVE_LIBOTR
|
||||||
if (args[0] == NULL) {
|
|
||||||
cons_bad_cmd_usage(command);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strcmp(args[0], "char") == 0) {
|
|
||||||
if (args[1] == NULL) {
|
if (args[1] == NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else if (strlen(args[1]) != 1) {
|
} else if (strlen(args[1]) != 1) {
|
||||||
@@ -5982,7 +6086,16 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_show("OTR char set to %c.", args[1][0]);
|
cons_show("OTR char set to %c.", args[1][0]);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else if (strcmp(args[0], "log") == 0) {
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_log(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
char *choice = args[1];
|
char *choice = args[1];
|
||||||
if (g_strcmp0(choice, "on") == 0) {
|
if (g_strcmp0(choice, "on") == 0) {
|
||||||
prefs_set_string(PREF_OTR_LOG, "on");
|
prefs_set_string(PREF_OTR_LOG, "on");
|
||||||
@@ -6003,13 +6116,29 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "libver") == 0) {
|
gboolean
|
||||||
|
cmd_otr_libver(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
char *version = otr_libotr_version();
|
char *version = otr_libotr_version();
|
||||||
cons_show("Using libotr version %s", version);
|
cons_show("Using libotr version %s", version);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "policy") == 0) {
|
gboolean
|
||||||
|
cmd_otr_policy(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
if (args[1] == NULL) {
|
if (args[1] == NULL) {
|
||||||
char *policy = prefs_get_string(PREF_OTR_POLICY);
|
char *policy = prefs_get_string(PREF_OTR_POLICY);
|
||||||
cons_show("OTR policy is now set to: %s", policy);
|
cons_show("OTR policy is now set to: %s", policy);
|
||||||
@@ -6030,11 +6159,13 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
prefs_set_string(PREF_OTR_POLICY, choice);
|
prefs_set_string(PREF_OTR_POLICY, choice);
|
||||||
cons_show("OTR policy is now set to: %s", choice);
|
cons_show("OTR policy is now set to: %s", choice);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
cons_show("You must be connected to set the OTR policy for a contact.");
|
cons_show("You must be connected to set the OTR policy for a contact.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *contact_jid = roster_barejid_from_name(contact);
|
char *contact_jid = roster_barejid_from_name(contact);
|
||||||
if (contact_jid == NULL) {
|
if (contact_jid == NULL) {
|
||||||
contact_jid = contact;
|
contact_jid = contact;
|
||||||
@@ -6042,21 +6173,40 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
accounts_add_otr_policy(jabber_get_account_name(), contact_jid, choice);
|
accounts_add_otr_policy(jabber_get_account_name(), contact_jid, choice);
|
||||||
cons_show("OTR policy for %s set to: %s", contact_jid, choice);
|
cons_show("OTR policy for %s set to: %s", contact_jid, choice);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
#else
|
||||||
}
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_gen(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
cons_show("You must be connected with an account to load OTR information.");
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(args[0], "gen") == 0) {
|
|
||||||
ProfAccount *account = accounts_get_account(jabber_get_account_name());
|
ProfAccount *account = accounts_get_account(jabber_get_account_name());
|
||||||
otr_keygen(account);
|
otr_keygen(account);
|
||||||
account_free(account);
|
account_free(account);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_myfp(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "myfp") == 0) {
|
|
||||||
if (!otr_key_loaded()) {
|
if (!otr_key_loaded()) {
|
||||||
ui_current_print_formatted_line('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
|
ui_current_print_formatted_line('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -6066,8 +6216,21 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
ui_current_print_formatted_line('!', 0, "Your OTR fingerprint: %s", fingerprint);
|
ui_current_print_formatted_line('!', 0, "Your OTR fingerprint: %s", fingerprint);
|
||||||
free(fingerprint);
|
free(fingerprint);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_theirfp(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "theirfp") == 0) {
|
|
||||||
if (window->type != WIN_CHAT) {
|
if (window->type != WIN_CHAT) {
|
||||||
ui_current_print_line("You must be in a regular chat window to view a recipient's fingerprint.");
|
ui_current_print_line("You must be in a regular chat window to view a recipient's fingerprint.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -6084,8 +6247,21 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
ui_current_print_formatted_line('!', 0, "%s's OTR fingerprint: %s", chatwin->barejid, fingerprint);
|
ui_current_print_formatted_line('!', 0, "%s's OTR fingerprint: %s", chatwin->barejid, fingerprint);
|
||||||
free(fingerprint);
|
free(fingerprint);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_start(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "start") == 0) {
|
|
||||||
// recipient supplied
|
// recipient supplied
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
char *contact = args[1];
|
char *contact = args[1];
|
||||||
@@ -6154,8 +6330,21 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
free(id);
|
free(id);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_end(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "end") == 0) {
|
|
||||||
if (window->type != WIN_CHAT) {
|
if (window->type != WIN_CHAT) {
|
||||||
ui_current_print_line("You must be in a regular chat window to use OTR.");
|
ui_current_print_line("You must be in a regular chat window to use OTR.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -6171,8 +6360,21 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
chatwin_otr_unsecured(chatwin);
|
chatwin_otr_unsecured(chatwin);
|
||||||
otr_end_session(chatwin->barejid);
|
otr_end_session(chatwin->barejid);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_trust(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "trust") == 0) {
|
|
||||||
if (window->type != WIN_CHAT) {
|
if (window->type != WIN_CHAT) {
|
||||||
ui_current_print_line("You must be in an OTR session to trust a recipient.");
|
ui_current_print_line("You must be in an OTR session to trust a recipient.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -6188,8 +6390,21 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
chatwin_otr_trust(chatwin);
|
chatwin_otr_trust(chatwin);
|
||||||
otr_trust(chatwin->barejid);
|
otr_trust(chatwin->barejid);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_untrust(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "untrust") == 0) {
|
|
||||||
if (window->type != WIN_CHAT) {
|
if (window->type != WIN_CHAT) {
|
||||||
ui_current_print_line("You must be in an OTR session to untrust a recipient.");
|
ui_current_print_line("You must be in an OTR session to untrust a recipient.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -6205,8 +6420,21 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
chatwin_otr_untrust(chatwin);
|
chatwin_otr_untrust(chatwin);
|
||||||
otr_untrust(chatwin->barejid);
|
otr_untrust(chatwin->barejid);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_secret(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "secret") == 0) {
|
|
||||||
if (window->type != WIN_CHAT) {
|
if (window->type != WIN_CHAT) {
|
||||||
ui_current_print_line("You must be in an OTR session to trust a recipient.");
|
ui_current_print_line("You must be in an OTR session to trust a recipient.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -6227,8 +6455,21 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
|
|
||||||
otr_smp_secret(chatwin->barejid, secret);
|
otr_smp_secret(chatwin->barejid, secret);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_question(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "question") == 0) {
|
|
||||||
char *question = args[1];
|
char *question = args[1];
|
||||||
char *answer = args[2];
|
char *answer = args[2];
|
||||||
if (question == NULL || answer == NULL) {
|
if (question == NULL || answer == NULL) {
|
||||||
@@ -6250,8 +6491,21 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
|
|
||||||
otr_smp_question(chatwin->barejid, question, answer);
|
otr_smp_question(chatwin->barejid, question, answer);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_otr_answer(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (jabber_get_connection_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (strcmp(args[0], "answer") == 0) {
|
|
||||||
if (window->type != WIN_CHAT) {
|
if (window->type != WIN_CHAT) {
|
||||||
ui_current_print_line("You must be in an OTR session to trust a recipient.");
|
ui_current_print_line("You must be in an OTR session to trust a recipient.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -6272,11 +6526,6 @@ cmd_otr(ProfWin *window, const char *const command, gchar **args)
|
|||||||
|
|
||||||
otr_smp_answer(chatwin->barejid, answer);
|
otr_smp_answer(chatwin->barejid, answer);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
} else {
|
|
||||||
cons_bad_cmd_usage(command);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
cons_show("This version of Profanity has not been built with OTR support enabled");
|
cons_show("This version of Profanity has not been built with OTR support enabled");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
@@ -58,19 +58,31 @@ typedef struct cmd_help_t {
|
|||||||
*/
|
*/
|
||||||
typedef struct cmd_t {
|
typedef struct cmd_t {
|
||||||
gchar *cmd;
|
gchar *cmd;
|
||||||
gboolean (*func)(ProfWin *window, const char *const command, gchar **args);
|
|
||||||
gchar** (*parser)(const char *const inp, int min, int max, gboolean *result);
|
gchar** (*parser)(const char *const inp, int min, int max, gboolean *result);
|
||||||
int min_args;
|
int min_args;
|
||||||
int max_args;
|
int max_args;
|
||||||
void (*setting_func)(void);
|
void (*setting_func)(void);
|
||||||
|
void *sub_funcs[50][2];
|
||||||
|
gboolean (*func)(ProfWin *window, const char *const command, gchar **args);
|
||||||
CommandHelp help;
|
CommandHelp help;
|
||||||
} Command;
|
} Command;
|
||||||
|
|
||||||
gboolean cmd_execute_alias(ProfWin *window, const char *const inp, gboolean *ran);
|
gboolean cmd_execute_alias(ProfWin *window, const char *const inp, gboolean *ran);
|
||||||
gboolean cmd_execute_default(ProfWin *window, const char *inp);
|
gboolean cmd_execute_default(ProfWin *window, const char *inp);
|
||||||
|
|
||||||
gboolean cmd_about(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_about(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
|
||||||
gboolean cmd_account(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_account(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_list(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_show(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_add(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_remove(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_enable(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_disable(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_rename(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_default(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_set(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_account_clear(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
|
||||||
gboolean cmd_autoaway(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_autoaway(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_autoconnect(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_autoconnect(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_autoping(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_autoping(ProfWin *window, const char *const command, gchar **args);
|
||||||
@@ -82,7 +94,14 @@ gboolean cmd_chlog(ProfWin *window, const char *const command, gchar **args);
|
|||||||
gboolean cmd_clear(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_clear(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_close(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_close(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_connect(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_connect(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_tls(ProfWin *window, const char *const command, gchar **args);
|
|
||||||
|
gboolean cmd_tls_certpath(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_tls_trust(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_tls_trusted(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_tls_revoke(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_tls_show(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_tls_cert(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
|
||||||
gboolean cmd_decline(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_decline(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_disco(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_disco(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_lastactivity(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_lastactivity(ProfWin *window, const char *const command, gchar **args);
|
||||||
@@ -108,7 +127,22 @@ gboolean cmd_msg(ProfWin *window, const char *const command, gchar **args);
|
|||||||
gboolean cmd_nick(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_nick(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_notify(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_notify(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_online(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_online(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_otr(ProfWin *window, const char *const command, gchar **args);
|
|
||||||
|
gboolean cmd_otr_char(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_log(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_libver(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_policy(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_gen(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_myfp(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_theirfp(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_start(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_end(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_trust(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_untrust(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_secret(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_question(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_otr_answer(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
|
||||||
gboolean cmd_pgp(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_pgp(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_outtype(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_outtype(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_prefs(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_prefs(ProfWin *window, const char *const command, gchar **args);
|
||||||
@@ -131,7 +165,14 @@ gboolean cmd_titlebar(ProfWin *window, const char *const command, gchar **args);
|
|||||||
gboolean cmd_vercheck(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_vercheck(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_who(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_who(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_win(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_win(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
|
||||||
gboolean cmd_wins(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_wins(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_wins_unread(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_wins_tidy(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_wins_prune(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_wins_swap(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_wins_autotidy(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
|
||||||
gboolean cmd_xa(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_xa(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_alias(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_alias(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_xmlconsole(ProfWin *window, const char *const command, gchar **args);
|
gboolean cmd_xmlconsole(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
|||||||
Reference in New Issue
Block a user