mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Tidy up some code
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
parent
847a86de50
commit
835ea397ac
@ -652,7 +652,7 @@ format_call_external_argv(const char* template, const char* url, const char* fil
|
||||
return argv;
|
||||
}
|
||||
|
||||
gchar*
|
||||
static gchar*
|
||||
_unique_filename(const char* filename)
|
||||
{
|
||||
gchar* unique = g_strdup(filename);
|
||||
@ -676,7 +676,7 @@ _unique_filename(const char* filename)
|
||||
return unique;
|
||||
}
|
||||
|
||||
bool
|
||||
static bool
|
||||
_has_directory_suffix(const char* path)
|
||||
{
|
||||
return (g_str_has_suffix(path, ".")
|
||||
|
@ -190,8 +190,7 @@ sv_ev_roster_received(void)
|
||||
connection_set_presence_msg(status_message);
|
||||
cl_ev_presence_send(conn_presence, diff_secs);
|
||||
|
||||
const char* fulljid = connection_get_fulljid();
|
||||
plugins_on_connect(account_name, fulljid);
|
||||
plugins_on_connect(account_name, connection_get_fulljid());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -252,9 +252,7 @@ plugins_load(const char* const name, GString* error_message)
|
||||
if (plugin) {
|
||||
g_hash_table_insert(plugins, strdup(name), plugin);
|
||||
if (connection_get_status() == JABBER_CONNECTED) {
|
||||
const char* account_name = session_get_account_name();
|
||||
const char* fulljid = connection_get_fulljid();
|
||||
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS, account_name, fulljid);
|
||||
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS, session_get_account_name(), connection_get_fulljid());
|
||||
} else {
|
||||
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS, NULL, NULL);
|
||||
}
|
||||
|
@ -458,8 +458,7 @@ cons_show_login_success(ProfAccount* account, gboolean secured)
|
||||
{
|
||||
ProfWin* console = wins_get_console();
|
||||
|
||||
const char* fulljid = connection_get_fulljid();
|
||||
win_print(console, THEME_DEFAULT, "-", "%s logged in successfully, ", fulljid);
|
||||
win_print(console, THEME_DEFAULT, "-", "%s logged in successfully, ", connection_get_fulljid());
|
||||
|
||||
resource_presence_t presence = accounts_get_login_presence(account->name);
|
||||
const char* presence_str = string_from_resource_presence(presence);
|
||||
|
@ -836,9 +836,7 @@ connection_create_stanza_id(void)
|
||||
(guchar*)prof_identifier, strlen(prof_identifier),
|
||||
rndid, strlen(rndid));
|
||||
|
||||
char* ret = g_strdup_printf("%s%s", rndid, hmac);
|
||||
|
||||
return ret;
|
||||
return g_strdup_printf("%s%s", rndid, hmac);
|
||||
}
|
||||
|
||||
char*
|
||||
|
@ -209,9 +209,7 @@ session_disconnect(void)
|
||||
if (connection_get_status() == JABBER_CONNECTED) {
|
||||
log_info("Closing connection");
|
||||
|
||||
char* account_name = session_get_account_name();
|
||||
const char* fulljid = connection_get_fulljid();
|
||||
plugins_on_disconnect(account_name, fulljid);
|
||||
plugins_on_disconnect(session_get_account_name(), connection_get_fulljid());
|
||||
|
||||
accounts_set_last_activity(session_get_account_name());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user