1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Move uuid functions

This commit is contained in:
James Booth 2016-05-06 01:16:13 +01:00
parent d1c71e98f4
commit 31b0f0b0c8
5 changed files with 20 additions and 20 deletions

View File

@ -3465,9 +3465,9 @@ cmd_join(ProfWin *window, const char *const command, gchar **args)
ProfAccount *account = accounts_get_account(account_name);
GString *room_str = g_string_new("");
char *uuid = session_create_uuid();
char *uuid = connection_create_uuid();
g_string_append_printf(room_str, "private-chat-%s@%s", uuid, account->muc_service);
session_free_uuid(uuid);
connection_free_uuid(uuid);
presence_join_room(room_str->str, account->muc_nick, NULL);
muc_join(room_str->str, account->muc_nick, NULL, FALSE);

View File

@ -176,6 +176,20 @@ connection_get_fulljid(void)
return xmpp_conn_get_jid(conn.conn);
}
char*
connection_create_uuid(void)
{
return xmpp_uuid_gen(conn.ctx);
}
void
connection_free_uuid(char *uuid)
{
if (uuid) {
xmpp_free(conn.ctx, uuid);
}
}
char *
connection_get_domain(void)
{

View File

@ -317,20 +317,6 @@ session_get_account_name(void)
return saved_account.name;
}
char*
session_create_uuid(void)
{
return xmpp_uuid_gen(connection_get_ctx());
}
void
session_free_uuid(char *uuid)
{
if (uuid) {
xmpp_free(connection_get_ctx(), uuid);
}
}
void
session_add_available_resource(Resource *resource)
{

View File

@ -119,8 +119,6 @@ void session_shutdown(void);
void session_process_events(int millis);
char* session_get_account_name(void);
GList* session_get_available_resources(void);
char* session_create_uuid(void);
void session_free_uuid(char *uuid);
gboolean session_send_stanza(const char *const stanza);
#ifdef HAVE_LIBMESODE
@ -133,6 +131,8 @@ gboolean session_service_supports(const char *const feature);
jabber_conn_status_t connection_get_status(void);
char *connection_get_presence_msg(void);
const char* connection_get_fulljid(void);
char* connection_create_uuid(void);
void connection_free_uuid(char *uuid);
char* message_send_chat(const char *const barejid, const char *const msg, const char *const oob_url);
char* message_send_chat_otr(const char *const barejid, const char *const msg);

View File

@ -49,12 +49,12 @@ session_get_tls_peer_cert(void)
}
char* session_create_uuid(void)
char* connection_create_uuid(void)
{
return NULL;
}
void session_free_uuid(char * uuid) {}
void connection_free_uuid(char * uuid) {}
jabber_conn_status_t connection_get_status(void)
{