mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Initialise and free capabilities
This commit is contained in:
parent
7920a9b2f1
commit
22589e8798
@ -23,9 +23,20 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "capabilities.h"
|
#include "capabilities.h"
|
||||||
|
|
||||||
|
GHashTable *capabilities;
|
||||||
|
|
||||||
|
void
|
||||||
|
caps_init(void)
|
||||||
|
{
|
||||||
|
capabilities = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
|
||||||
|
(GDestroyNotify)caps_destroy);
|
||||||
|
}
|
||||||
|
|
||||||
Capabilities *
|
Capabilities *
|
||||||
caps_create(const char * const client, const char * const version)
|
caps_create(const char * const client, const char * const version)
|
||||||
{
|
{
|
||||||
@ -55,3 +66,9 @@ caps_destroy(Capabilities *caps)
|
|||||||
FREE_SET_NULL(caps);
|
FREE_SET_NULL(caps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
caps_close(void)
|
||||||
|
{
|
||||||
|
g_hash_table_destroy(capabilities);
|
||||||
|
}
|
||||||
|
@ -28,7 +28,9 @@ typedef struct capabilities_t {
|
|||||||
char *version;
|
char *version;
|
||||||
} Capabilities;
|
} Capabilities;
|
||||||
|
|
||||||
|
void caps_init(void);
|
||||||
Capabilities* caps_create(const char * const client, const char * const version);
|
Capabilities* caps_create(const char * const client, const char * const version);
|
||||||
void caps_destroy(Capabilities *caps);
|
void caps_destroy(Capabilities *caps);
|
||||||
|
void caps_close(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include "accounts.h"
|
#include "accounts.h"
|
||||||
|
#include "capabilities.h"
|
||||||
#include "chat_log.h"
|
#include "chat_log.h"
|
||||||
#include "chat_session.h"
|
#include "chat_session.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
@ -541,6 +542,7 @@ _init(const int disable_tls, char *log_level)
|
|||||||
theme_init(theme);
|
theme_init(theme);
|
||||||
g_free(theme);
|
g_free(theme);
|
||||||
ui_init();
|
ui_init();
|
||||||
|
caps_init();
|
||||||
jabber_init(disable_tls);
|
jabber_init(disable_tls);
|
||||||
cmd_init();
|
cmd_init();
|
||||||
log_info("Initialising contact list");
|
log_info("Initialising contact list");
|
||||||
@ -553,6 +555,7 @@ _shutdown(void)
|
|||||||
{
|
{
|
||||||
jabber_disconnect();
|
jabber_disconnect();
|
||||||
contact_list_free();
|
contact_list_free();
|
||||||
|
caps_close();
|
||||||
ui_close();
|
ui_close();
|
||||||
chat_log_close();
|
chat_log_close();
|
||||||
prefs_close();
|
prefs_close();
|
||||||
|
Loading…
Reference in New Issue
Block a user