1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 07:16:37 +02:00

Many changes in IRC plugin

This commit is contained in:
Sebastien Helleu
2007-12-10 17:18:40 +01:00
parent 8b3980f508
commit 256557f900
27 changed files with 1374 additions and 1252 deletions
+14
View File
@@ -29,6 +29,7 @@
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
#include "../../core/wee-utf8.h"
#include "../../plugins/plugin.h"
#include "../gui-status.h"
#include "../gui-color.h"
#include "../gui-main.h"
@@ -77,6 +78,19 @@ gui_status_draw (struct t_gui_buffer *buffer, int erase)
GUI_COLOR_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
/* display buffer plugin */
if (ptr_win->buffer->plugin)
{
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
GUI_COLOR_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
ptr_win->buffer->plugin->name);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
GUI_COLOR_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
}
/* display buffer category */
if (ptr_win->buffer->category)
{
+8 -7
View File
@@ -38,6 +38,7 @@
#include "../core/wee-log.h"
#include "../core/wee-string.h"
#include "../core/wee-utf8.h"
#include "../plugins/plugin.h"
#include "gui-buffer.h"
#include "gui-chat.h"
#include "gui-color.h"
@@ -49,7 +50,6 @@
#include "gui-nicklist.h"
#include "gui-status.h"
#include "gui-window.h"
#include "../plugins/plugin.h"
struct t_gui_buffer *gui_buffers = NULL; /* first buffer */
@@ -92,7 +92,7 @@ gui_buffer_new (void *plugin, char *category, char *name,
if ((new_buffer = (struct t_gui_buffer *)(malloc (sizeof (struct t_gui_buffer)))))
{
/* init buffer */
new_buffer->plugin = (struct t_weechat_plugin *)plugin;
new_buffer->plugin = plugin;
new_buffer->number = (last_gui_buffer) ? last_gui_buffer->number + 1 : 1;
new_buffer->category = (category) ? strdup (category) : NULL;
new_buffer->name = strdup (name);
@@ -212,12 +212,11 @@ gui_buffer_valid (struct t_gui_buffer *buffer)
* gui_buffer_get: get a buffer property
*/
char *
void *
gui_buffer_get (struct t_gui_buffer *buffer, char *property)
{
long number;
char *error;
if (string_strcasecmp (property, "plugin") == 0)
return buffer->plugin;
if (string_strcasecmp (property, "category") == 0)
return buffer->category;
else if (string_strcasecmp (property, "name") == 0)
@@ -225,7 +224,9 @@ gui_buffer_get (struct t_gui_buffer *buffer, char *property)
else if (string_strcasecmp (property, "title") == 0)
return buffer->title;
else if (string_strcasecmp (property, "nick") == 0)
return buffer->nick;
return buffer->input_nick;
return NULL;
}
/*
+2 -2
View File
@@ -63,7 +63,7 @@ struct t_gui_nick
struct t_gui_buffer
{
void *plugin; /* plugin which created this buffer */
struct t_weechat_plugin *plugin; /* plugin which created this buffer */
/* (NULL for a WeeChat buffer) */
int number; /* buffer number (for jump/switch) */
char *category; /* category name */
@@ -142,7 +142,7 @@ extern struct t_gui_buffer *gui_buffer_before_raw_data;
extern struct t_gui_buffer *gui_buffer_new (void *, char *, char *,
void (*)(struct t_gui_buffer *, char *));
extern int gui_buffer_valid (struct t_gui_buffer *);
extern char *gui_buffer_get (struct t_gui_buffer *, char *);
extern void *gui_buffer_get (struct t_gui_buffer *, char *);
extern void gui_buffer_set_category (struct t_gui_buffer *, char *);
extern void gui_buffer_set_name (struct t_gui_buffer *, char *);
extern void gui_buffer_set_log (struct t_gui_buffer *, char *);
+1
View File
@@ -43,6 +43,7 @@
char *gui_chat_prefix[GUI_CHAT_PREFIX_NUMBER]; /* prefixes */
char gui_chat_prefix_empty[] = ""; /* empty prefix */
int gui_chat_time_length = 0; /* length of time for each line (in chars) */
+1
View File
@@ -38,6 +38,7 @@ enum t_gui_prefix
};
extern char *gui_chat_prefix[GUI_CHAT_PREFIX_NUMBER];
extern char gui_chat_prefix_empty[];
extern int gui_chat_time_length;
/* chat functions */