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

Renamed jabber_presence_t->presence_t

This commit is contained in:
James Booth 2013-02-10 11:31:31 +00:00
parent ec78914044
commit 591f8a8dbf
15 changed files with 29 additions and 29 deletions

View File

@ -68,7 +68,7 @@ struct cmd_t {
}; };
static struct cmd_t * _cmd_get_command(const char * const command); static struct cmd_t * _cmd_get_command(const char * const command);
static void _update_presence(const jabber_presence_t presence, static void _update_presence(const presence_t presence,
const char * const show, gchar **args); const char * const show, gchar **args);
static gboolean _cmd_set_boolean_preference(gchar *arg, struct cmd_help_t help, static gboolean _cmd_set_boolean_preference(gchar *arg, struct cmd_help_t help,
const char * const display, preference_t pref); const char * const display, preference_t pref);
@ -85,7 +85,7 @@ static void _parameter_autocomplete_with_ac(char *input, int *size, char *comman
Autocomplete ac); Autocomplete ac);
static int _strtoi(char *str, int *saveptr, int min, int max); static int _strtoi(char *str, int *saveptr, int min, int max);
static jabber_presence_t _presence_type_from_string(const char * const str); static presence_t _presence_type_from_string(const char * const str);
// command prototypes // command prototypes
static gboolean _cmd_quit(gchar **args, struct cmd_help_t help); static gboolean _cmd_quit(gchar **args, struct cmd_help_t help);
@ -1175,7 +1175,7 @@ _cmd_account(gchar **args, struct cmd_help_t help)
int intval; int intval;
if (_strtoi(value, &intval, -128, 127) == 0) { if (_strtoi(value, &intval, -128, 127) == 0) {
jabber_presence_t presence_type = _presence_type_from_string(property); presence_t presence_type = _presence_type_from_string(property);
switch (presence_type) switch (presence_type)
{ {
case (PRESENCE_ONLINE): case (PRESENCE_ONLINE):
@ -2348,7 +2348,7 @@ _cmd_xa(gchar **args, struct cmd_help_t help)
// helper function for status change commands // helper function for status change commands
static void static void
_update_presence(const jabber_presence_t presence, _update_presence(const presence_t presence,
const char * const show, gchar **args) const char * const show, gchar **args)
{ {
char *msg = NULL; char *msg = NULL;
@ -2648,7 +2648,7 @@ _strtoi(char *str, int *saveptr, int min, int max)
return 0; return 0;
} }
static jabber_presence_t static presence_t
_presence_type_from_string(const char * const str) _presence_type_from_string(const char * const str)
{ {
if (str == NULL) { if (str == NULL) {

View File

@ -62,7 +62,7 @@ typedef enum {
PRESENCE_DND, PRESENCE_DND,
PRESENCE_CHAT, PRESENCE_CHAT,
PRESENCE_XA PRESENCE_XA
} jabber_presence_t; } presence_t;
gchar* p_utf8_substring(const gchar *str, glong start_pos, glong end_pos); gchar* p_utf8_substring(const gchar *str, glong start_pos, glong end_pos);
void p_slist_free_full(GSList *items, GDestroyNotify free_func); void p_slist_free_full(GSList *items, GDestroyNotify free_func);

View File

@ -403,7 +403,7 @@ accounts_set_priority_all(const char * const account_name, const gint value)
gint gint
accounts_get_priority_for_presence_type(const char * const account_name, accounts_get_priority_for_presence_type(const char * const account_name,
jabber_presence_t presence_type) presence_t presence_type)
{ {
gint result; gint result;
@ -453,7 +453,7 @@ accounts_set_login_presence(const char * const account_name, const char * const
} }
} }
jabber_presence_t presence_t
accounts_get_last_presence(const char * const account_name) accounts_get_last_presence(const char * const account_name)
{ {
gchar *setting = g_key_file_get_string(accounts, account_name, "presence.last", NULL); gchar *setting = g_key_file_get_string(accounts, account_name, "presence.last", NULL);
@ -474,7 +474,7 @@ accounts_get_last_presence(const char * const account_name)
} }
} }
jabber_presence_t presence_t
accounts_get_login_presence(const char * const account_name) accounts_get_login_presence(const char * const account_name)
{ {
gchar *setting = g_key_file_get_string(accounts, account_name, "presence.login", NULL); gchar *setting = g_key_file_get_string(accounts, account_name, "presence.login", NULL);

View File

@ -61,8 +61,8 @@ void accounts_set_server(const char * const account_name, const char * const val
void accounts_set_resource(const char * const account_name, const char * const value); void accounts_set_resource(const char * const account_name, const char * const value);
void accounts_set_last_presence(const char * const account_name, const char * const value); void accounts_set_last_presence(const char * const account_name, const char * const value);
void accounts_set_login_presence(const char * const account_name, const char * const value); void accounts_set_login_presence(const char * const account_name, const char * const value);
jabber_presence_t accounts_get_login_presence(const char * const account_name); presence_t accounts_get_login_presence(const char * const account_name);
jabber_presence_t accounts_get_last_presence(const char * const account_name); presence_t accounts_get_last_presence(const char * const account_name);
void accounts_set_priority_online(const char * const account_name, const gint value); void accounts_set_priority_online(const char * const account_name, const gint value);
void accounts_set_priority_chat(const char * const account_name, const gint value); void accounts_set_priority_chat(const char * const account_name, const gint value);
void accounts_set_priority_away(const char * const account_name, const gint value); void accounts_set_priority_away(const char * const account_name, const gint value);
@ -70,6 +70,6 @@ void accounts_set_priority_xa(const char * const account_name, const gint value)
void accounts_set_priority_dnd(const char * const account_name, const gint value); void accounts_set_priority_dnd(const char * const account_name, const gint value);
void accounts_set_priority_all(const char * const account_name, const gint value); void accounts_set_priority_all(const char * const account_name, const gint value);
gint accounts_get_priority_for_presence_type(const char * const account_name, gint accounts_get_priority_for_presence_type(const char * const account_name,
jabber_presence_t presence_type); presence_t presence_type);
#endif #endif

View File

@ -189,7 +189,7 @@ void
prof_handle_login_account_success(char *account_name) prof_handle_login_account_success(char *account_name)
{ {
ProfAccount *account = accounts_get_account(account_name); ProfAccount *account = accounts_get_account(account_name);
jabber_presence_t presence = accounts_get_login_presence(account->name); presence_t presence = accounts_get_login_presence(account->name);
cons_show_login_success(account); cons_show_login_success(account);
title_bar_set_status(presence); title_bar_set_status(presence);
log_info("%s logged in successfully", account->jid); log_info("%s logged in successfully", account->jid);

View File

@ -32,7 +32,7 @@ static char *current_title = NULL;
static char *recipient = NULL; static char *recipient = NULL;
static GTimer *typing_elapsed; static GTimer *typing_elapsed;
static int dirty; static int dirty;
static jabber_presence_t current_status; static presence_t current_status;
static void _title_bar_draw_title(void); static void _title_bar_draw_title(void);
static void _title_bar_draw_status(void); static void _title_bar_draw_status(void);
@ -119,7 +119,7 @@ title_bar_show(const char * const title)
} }
void void
title_bar_set_status(jabber_presence_t status) title_bar_set_status(presence_t status)
{ {
current_status = status; current_status = status;
_title_bar_draw_status(); _title_bar_draw_status();

View File

@ -92,7 +92,7 @@ void title_bar_refresh(void);
void title_bar_resize(void); void title_bar_resize(void);
void title_bar_show(const char * const title); void title_bar_show(const char * const title);
void title_bar_title(void); void title_bar_title(void);
void title_bar_set_status(jabber_presence_t status); void title_bar_set_status(presence_t status);
void title_bar_set_recipient(char *from); void title_bar_set_recipient(char *from);
void title_bar_set_typing(gboolean is_typing); void title_bar_set_typing(gboolean is_typing);
void title_bar_draw(void); void title_bar_draw(void);

View File

@ -1094,7 +1094,7 @@ cons_show_login_success(ProfAccount *account)
_win_show_time(console->win, '-'); _win_show_time(console->win, '-');
wprintw(console->win, "%s logged in successfully, ", account->jid); wprintw(console->win, "%s logged in successfully, ", account->jid);
jabber_presence_t presence = accounts_get_login_presence(account->name); presence_t presence = accounts_get_login_presence(account->name);
char *presence_str; char *presence_str;
switch(presence) switch(presence)
{ {

View File

@ -47,7 +47,7 @@ static struct _jabber_conn_t {
xmpp_ctx_t *ctx; xmpp_ctx_t *ctx;
xmpp_conn_t *conn; xmpp_conn_t *conn;
jabber_conn_status_t conn_status; jabber_conn_status_t conn_status;
jabber_presence_t presence_type; presence_t presence_type;
char *presence_message; char *presence_message;
int priority; int priority;
int tls_disabled; int tls_disabled;
@ -228,7 +228,7 @@ jabber_get_jid(void)
return xmpp_conn_get_jid(jabber_conn.conn); return xmpp_conn_get_jid(jabber_conn.conn);
} }
jabber_presence_t presence_t
jabber_get_presence_type(void) jabber_get_presence_type(void)
{ {
return jabber_conn.presence_type; return jabber_conn.presence_type;
@ -247,7 +247,7 @@ jabber_get_account_name(void)
} }
void void
connection_set_presence_type(const jabber_presence_t presence_type) connection_set_presence_type(const presence_t presence_type)
{ {
jabber_conn.presence_type = presence_type; jabber_conn.presence_type = presence_type;
} }

View File

@ -29,7 +29,7 @@ void connection_free_resources(void);
xmpp_conn_t *connection_get_conn(void); xmpp_conn_t *connection_get_conn(void);
xmpp_ctx_t *connection_get_ctx(void); xmpp_ctx_t *connection_get_ctx(void);
int connection_error_handler(xmpp_stanza_t * const stanza); int connection_error_handler(xmpp_stanza_t * const stanza);
void connection_set_presence_type(jabber_presence_t presence_type); void connection_set_presence_type(presence_t presence_type);
void connection_set_priority(int priority); void connection_set_priority(int priority);
void connection_set_presence_message(const char * const message); void connection_set_presence_message(const char * const message);

View File

@ -153,7 +153,7 @@ _iq_handle_roster_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
item = xmpp_stanza_get_next(item); item = xmpp_stanza_get_next(item);
} }
jabber_presence_t connect_presence = accounts_get_login_presence(jabber_get_account_name()); presence_t connect_presence = accounts_get_login_presence(jabber_get_account_name());
presence_update(connect_presence, NULL, 0); presence_update(connect_presence, NULL, 0);
} }

View File

@ -106,7 +106,7 @@ presence_free_sub_requests(void)
} }
void void
presence_update(jabber_presence_t presence_type, const char * const msg, presence_update(presence_t presence_type, const char * const msg,
int idle) int idle)
{ {
xmpp_ctx_t *ctx = connection_get_ctx(); xmpp_ctx_t *ctx = connection_get_ctx();
@ -161,7 +161,7 @@ presence_join_room(Jid *jid)
{ {
xmpp_ctx_t *ctx = connection_get_ctx(); xmpp_ctx_t *ctx = connection_get_ctx();
xmpp_conn_t *conn = connection_get_conn(); xmpp_conn_t *conn = connection_get_conn();
jabber_presence_t presence_type = jabber_get_presence_type(); presence_t presence_type = jabber_get_presence_type();
const char *show = stanza_get_presence_string_from_type(presence_type); const char *show = stanza_get_presence_string_from_type(presence_type);
char *status = jabber_get_presence_message(); char *status = jabber_get_presence_message();
int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(), int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(),
@ -184,7 +184,7 @@ presence_change_room_nick(const char * const room, const char * const nick)
{ {
xmpp_ctx_t *ctx = connection_get_ctx(); xmpp_ctx_t *ctx = connection_get_ctx();
xmpp_conn_t *conn = connection_get_conn(); xmpp_conn_t *conn = connection_get_conn();
jabber_presence_t presence_type = jabber_get_presence_type(); presence_t presence_type = jabber_get_presence_type();
const char *show = stanza_get_presence_string_from_type(presence_type); const char *show = stanza_get_presence_string_from_type(presence_type);
char *status = jabber_get_presence_message(); char *status = jabber_get_presence_message();
int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(), int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(),

View File

@ -664,7 +664,7 @@ stanza_attach_caps(xmpp_ctx_t * const ctx, xmpp_stanza_t * const presence)
} }
const char * const char *
stanza_get_presence_string_from_type(jabber_presence_t presence_type) stanza_get_presence_string_from_type(presence_t presence_type)
{ {
switch(presence_type) switch(presence_type)
{ {

View File

@ -160,6 +160,6 @@ void stanza_attach_show(xmpp_ctx_t * const ctx, xmpp_stanza_t * const presence,
void stanza_attach_status(xmpp_ctx_t * const ctx, xmpp_stanza_t * const presence, void stanza_attach_status(xmpp_ctx_t * const ctx, xmpp_stanza_t * const presence,
const char * const status); const char * const status);
const char * stanza_get_presence_string_from_type(jabber_presence_t presence_type); const char * stanza_get_presence_string_from_type(presence_t presence_type);
#endif #endif

View File

@ -66,7 +66,7 @@ void jabber_disconnect(void);
void jabber_process_events(void); void jabber_process_events(void);
const char * jabber_get_jid(void); const char * jabber_get_jid(void);
jabber_conn_status_t jabber_get_connection_status(void); jabber_conn_status_t jabber_get_connection_status(void);
jabber_presence_t jabber_get_presence_type(void); presence_t jabber_get_presence_type(void);
char * jabber_get_presence_message(void); char * jabber_get_presence_message(void);
void jabber_set_autoping(int seconds); void jabber_set_autoping(int seconds);
char* jabber_get_account_name(void); char* jabber_get_account_name(void);
@ -85,7 +85,7 @@ GList* presence_get_subscription_requests(void);
void presence_join_room(Jid *jid); void presence_join_room(Jid *jid);
void presence_change_room_nick(const char * const room, const char * const nick); void presence_change_room_nick(const char * const room, const char * const nick);
void presence_leave_chat_room(const char * const room_jid); void presence_leave_chat_room(const char * const room_jid);
void presence_update(jabber_presence_t status, const char * const msg, void presence_update(presence_t status, const char * const msg,
int idle); int idle);
// caps functions // caps functions