1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Removed some oneliner functions

This commit is contained in:
James Booth 2012-05-10 01:22:47 +01:00
parent 1266c87a12
commit d7cee5bec9
3 changed files with 7 additions and 31 deletions

View File

@ -112,10 +112,10 @@ static gboolean _cmd_connect(const char * const inp)
jabber_status_t conn_status = jabber_connection_status(); jabber_status_t conn_status = jabber_connection_status();
if ((conn_status != JABBER_DISCONNECTED) && (conn_status != JABBER_STARTED)) { if ((conn_status != JABBER_DISCONNECTED) && (conn_status != JABBER_STARTED)) {
cons_not_disconnected(); cons_show("You are either connected already, or a login is in process.");
result = TRUE; result = TRUE;
} else if (strlen(inp) < 10) { } else if (strlen(inp) < 10) {
cons_bad_connect(); cons_show("Usage: /connect user@host");
result = TRUE; result = TRUE;
} else { } else {
char *user; char *user;
@ -156,7 +156,7 @@ static gboolean _cmd_ros(void)
jabber_status_t conn_status = jabber_connection_status(); jabber_status_t conn_status = jabber_connection_status();
if (conn_status != JABBER_CONNECTED) if (conn_status != JABBER_CONNECTED)
cons_not_connected(); cons_show("You are not currently connected.");
else else
jabber_roster_request(); jabber_roster_request();
@ -168,7 +168,7 @@ static gboolean _cmd_who(void)
jabber_status_t conn_status = jabber_connection_status(); jabber_status_t conn_status = jabber_connection_status();
if (conn_status != JABBER_CONNECTED) { if (conn_status != JABBER_CONNECTED) {
cons_not_connected(); cons_show("You are not currently connected.");
} else { } else {
GSList *list = get_contact_list(); GSList *list = get_contact_list();
cons_show_online_contacts(list); cons_show_online_contacts(list);
@ -185,7 +185,7 @@ static gboolean _cmd_msg(const char * const inp)
jabber_status_t conn_status = jabber_connection_status(); jabber_status_t conn_status = jabber_connection_status();
if (conn_status != JABBER_CONNECTED) { if (conn_status != JABBER_CONNECTED) {
cons_not_connected(); cons_show("You are not currently connected.");
} else { } else {
// copy input // copy input
char inp_cpy[strlen(inp) + 1]; char inp_cpy[strlen(inp) + 1];
@ -201,10 +201,10 @@ static gboolean _cmd_msg(const char * const inp)
jabber_send(msg, usr); jabber_send(msg, usr);
win_show_outgoing_msg("me", usr, msg); win_show_outgoing_msg("me", usr, msg);
} else { } else {
cons_bad_message(); cons_show("Usage: /msg user@host message");
} }
} else { } else {
cons_bad_message(); cons_show("Usage: /msg user@host message");
} }
} }

View File

@ -347,26 +347,6 @@ void cons_bad_command(const char * const cmd)
dirty = TRUE; dirty = TRUE;
} }
void cons_bad_connect(void)
{
cons_show("Usage: /connect user@host");
}
void cons_not_disconnected(void)
{
cons_show("You are either connected already, or a login is in process.");
}
void cons_not_connected(void)
{
cons_show("You are not currently connected.");
}
void cons_bad_message(void)
{
cons_show("Usage: /msg user@host message");
}
void win_handle_special_keys(const int * const ch) void win_handle_special_keys(const int * const ch)
{ {
_win_handle_switch(ch); _win_handle_switch(ch);

View File

@ -72,10 +72,6 @@ void win_set_beep(int val);
// console window actions // console window actions
void cons_help(void); void cons_help(void);
void cons_bad_command(const char * const cmd); void cons_bad_command(const char * const cmd);
void cons_bad_connect(void);
void cons_not_disconnected(void);
void cons_not_connected(void);
void cons_bad_message(void);
void cons_show(const char * const cmd); void cons_show(const char * const cmd);
void cons_bad_show(const char * const cmd); void cons_bad_show(const char * const cmd);
void cons_highlight_show(const char * const cmd); void cons_highlight_show(const char * const cmd);