Implemented tox_weechat_identity_delete.

master
Håvard Pettersson 10 years ago
parent 10c704da6f
commit bc85c337a6

@ -23,6 +23,7 @@
#include <string.h>
#include <pwd.h>
#include <unistd.h>
#include <stdbool.h>
#include <weechat/weechat-plugin.h>
#include <tox/tox.h>
@ -349,6 +350,18 @@ tox_weechat_identity_for_buffer(struct t_gui_buffer *buffer)
return NULL;
}
void
tox_weechat_identity_delete(struct t_tox_weechat_identity *identity,
bool keep_data)
{
char *data_path = tox_weechat_identity_data_file_path(identity);
tox_weechat_identity_free(identity);
if (!keep_data)
unlink(data_path);
}
void
tox_weechat_identity_free(struct t_tox_weechat_identity *identity)
{

@ -21,6 +21,7 @@
#define TOX_WEECHAT_IDENTITIES_H
#include <stdint.h>
#include <stdbool.h>
enum t_tox_weechat_identity_option
{
@ -75,6 +76,10 @@ tox_weechat_identity_name_search(const char *name);
struct t_tox_weechat_identity *
tox_weechat_identity_for_buffer(struct t_gui_buffer *buffer);
void
tox_weechat_identity_delete(struct t_tox_weechat_identity *identity,
bool keep_data);
void
tox_weechat_identity_free(struct t_tox_weechat_identity *identity);

Loading…
Cancel
Save