Added online_status flag.

This commit is contained in:
Håvard Pettersson 2014-09-02 23:11:35 +02:00
parent 684d869503
commit fdccf7b7af
3 changed files with 39 additions and 5 deletions

View File

@ -8,7 +8,8 @@
#include "tox-weechat.h" #include "tox-weechat.h"
#include "tox-weechat-utils.h" #include "tox-weechat-utils.h"
char *bar_item_input_prompt(void *data, char *
bar_item_input_prompt(void *data,
struct t_gui_bar_item *item, struct t_gui_bar_item *item,
struct t_gui_window *window, struct t_gui_window *window,
struct t_gui_buffer *buffer, struct t_gui_buffer *buffer,
@ -17,6 +18,37 @@ char *bar_item_input_prompt(void *data,
return tox_weechat_get_self_name_nt(); return tox_weechat_get_self_name_nt();
} }
char *
irc_bar_item_buffer_plugin(void *data, struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
char string[512];
const char *name = weechat_plugin_get_name(weechat_plugin);
char *status = "online"
snprintf(string, sizeof(string), "%s %s%s",
name,
weechat_color("
);
}
else
{
snprintf (buf, sizeof (buf), "%s", name);
}
}
else
{
snprintf (buf, sizeof (buf), "%s", name);
}
return strdup (buf);
}
void tox_weechat_gui_init() void tox_weechat_gui_init()
{ {
weechat_bar_item_new("input_prompt", bar_item_input_prompt, NULL); weechat_bar_item_new("input_prompt", bar_item_input_prompt, NULL);

View File

@ -17,6 +17,7 @@ WEECHAT_PLUGIN_LICENSE("MIT");
struct t_weechat_plugin *weechat_plugin = NULL; struct t_weechat_plugin *weechat_plugin = NULL;
struct t_gui_buffer *tox_main_buffer = NULL; struct t_gui_buffer *tox_main_buffer = NULL;
int online_status = 0;
int int
weechat_plugin_init(struct t_weechat_plugin *plugin, int argc, char *argv[]) weechat_plugin_init(struct t_weechat_plugin *plugin, int argc, char *argv[])

View File

@ -5,6 +5,7 @@
extern struct t_weechat_plugin *weechat_plugin; extern struct t_weechat_plugin *weechat_plugin;
extern Tox *tox; extern Tox *tox;
extern int online_status;
extern struct t_gui_buffer *tox_main_buffer; extern struct t_gui_buffer *tox_main_buffer;