mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Renamed console window functions
This commit is contained in:
parent
9e63c4a0f6
commit
bff2210b7f
10
command.c
10
command.c
@ -18,7 +18,7 @@ int handle_start_command(char *cmd)
|
|||||||
if (strcmp(cmd, "/quit") == 0) {
|
if (strcmp(cmd, "/quit") == 0) {
|
||||||
result = QUIT_PROF;
|
result = QUIT_PROF;
|
||||||
} else if (strncmp(cmd, "/help", 5) == 0) {
|
} else if (strncmp(cmd, "/help", 5) == 0) {
|
||||||
win_cons_help();
|
cons_help();
|
||||||
result = AWAIT_COMMAND;
|
result = AWAIT_COMMAND;
|
||||||
} else if (strncmp(cmd, "/connect ", 9) == 0) {
|
} else if (strncmp(cmd, "/connect ", 9) == 0) {
|
||||||
char *user;
|
char *user;
|
||||||
@ -32,7 +32,7 @@ int handle_start_command(char *cmd)
|
|||||||
jabber_connect(user, passwd);
|
jabber_connect(user, passwd);
|
||||||
result = START_MAIN;
|
result = START_MAIN;
|
||||||
} else {
|
} else {
|
||||||
win_cons_bad_command(cmd);
|
cons_bad_command(cmd);
|
||||||
result = AWAIT_COMMAND;
|
result = AWAIT_COMMAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ static int _cmd_quit(void)
|
|||||||
|
|
||||||
static int _cmd_help(void)
|
static int _cmd_help(void)
|
||||||
{
|
{
|
||||||
win_cons_help();
|
cons_help();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ static int _cmd_close(char *cmd)
|
|||||||
if (win_in_chat()) {
|
if (win_in_chat()) {
|
||||||
win_close_win();
|
win_close_win();
|
||||||
} else {
|
} else {
|
||||||
win_cons_bad_command(cmd);
|
cons_bad_command(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -121,7 +121,7 @@ static int _cmd_default(char *cmd)
|
|||||||
jabber_send(cmd, recipient);
|
jabber_send(cmd, recipient);
|
||||||
win_show_outgoing_msg("me", recipient, cmd);
|
win_show_outgoing_msg("me", recipient, cmd);
|
||||||
} else {
|
} else {
|
||||||
win_cons_bad_command(cmd);
|
cons_bad_command(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
6
jabber.c
6
jabber.c
@ -157,19 +157,19 @@ static int _roster_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanz
|
|||||||
log_msg(CONN, "ERROR: query failed");
|
log_msg(CONN, "ERROR: query failed");
|
||||||
else {
|
else {
|
||||||
query = xmpp_stanza_get_child_by_name(stanza, "query");
|
query = xmpp_stanza_get_child_by_name(stanza, "query");
|
||||||
win_cons_show("Roster:");
|
cons_show("Roster:");
|
||||||
for (item = xmpp_stanza_get_children(query); item;
|
for (item = xmpp_stanza_get_children(query); item;
|
||||||
item = xmpp_stanza_get_next(item)) {
|
item = xmpp_stanza_get_next(item)) {
|
||||||
if ((name = xmpp_stanza_get_attribute(item, "name"))) {
|
if ((name = xmpp_stanza_get_attribute(item, "name"))) {
|
||||||
char line[200];
|
char line[200];
|
||||||
sprintf(line, " %s (%s)", name,
|
sprintf(line, " %s (%s)", name,
|
||||||
xmpp_stanza_get_attribute(item, "jid"));
|
xmpp_stanza_get_attribute(item, "jid"));
|
||||||
win_cons_show(line);
|
cons_show(line);
|
||||||
} else {
|
} else {
|
||||||
char line[200];
|
char line[200];
|
||||||
sprintf(line, " %s",
|
sprintf(line, " %s",
|
||||||
xmpp_stanza_get_attribute(item, "jid"));
|
xmpp_stanza_get_attribute(item, "jid"));
|
||||||
win_cons_show(line);
|
cons_show(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ void win_show_outgoing_msg(char *from, char *to, char *message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void win_cons_help(void)
|
void cons_help(void)
|
||||||
{
|
{
|
||||||
char tstmp[80];
|
char tstmp[80];
|
||||||
get_time(tstmp);
|
get_time(tstmp);
|
||||||
@ -224,7 +224,7 @@ void win_cons_help(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void win_cons_show(char *msg)
|
void cons_show(char *msg)
|
||||||
{
|
{
|
||||||
char tstmp[80];
|
char tstmp[80];
|
||||||
get_time(tstmp);
|
get_time(tstmp);
|
||||||
@ -238,7 +238,7 @@ void win_cons_show(char *msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void win_cons_bad_command(char *cmd)
|
void cons_bad_command(char *cmd)
|
||||||
{
|
{
|
||||||
char tstmp[80];
|
char tstmp[80];
|
||||||
get_time(tstmp);
|
get_time(tstmp);
|
||||||
|
@ -42,8 +42,10 @@ int win_in_chat(void);
|
|||||||
void win_get_recipient(char *recipient);
|
void win_get_recipient(char *recipient);
|
||||||
void win_show_incomming_msg(char *from, char *message);
|
void win_show_incomming_msg(char *from, char *message);
|
||||||
void win_show_outgoing_msg(char *from, char *to, char *message);
|
void win_show_outgoing_msg(char *from, char *to, char *message);
|
||||||
void win_cons_help(void);
|
|
||||||
void win_cons_bad_command(char *cmd);
|
// console window actions
|
||||||
void win_cons_show(char *cmd);
|
void cons_help(void);
|
||||||
|
void cons_bad_command(char *cmd);
|
||||||
|
void cons_show(char *cmd);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user