mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
NICK_REC can be now inherited
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@971 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
809fa17d82
commit
a99e93ef5d
@ -79,6 +79,7 @@ noinst_HEADERS = \
|
|||||||
net-nonblock.h \
|
net-nonblock.h \
|
||||||
net-sendbuffer.h \
|
net-sendbuffer.h \
|
||||||
network.h \
|
network.h \
|
||||||
|
nick-rec.h \
|
||||||
nicklist.h \
|
nicklist.h \
|
||||||
pidwait.h \
|
pidwait.h \
|
||||||
queries.h \
|
queries.h \
|
||||||
|
23
src/core/nick-rec.h
Normal file
23
src/core/nick-rec.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/* NICK_REC definition, used for inheritance */
|
||||||
|
|
||||||
|
int type; /* module_get_uniq_id("NICK", 0) */
|
||||||
|
int chat_type; /* chat_protocol_lookup(xx) */
|
||||||
|
|
||||||
|
time_t last_check; /* last time gone was checked */
|
||||||
|
|
||||||
|
char *nick;
|
||||||
|
char *host;
|
||||||
|
char *realname;
|
||||||
|
int hops;
|
||||||
|
|
||||||
|
/* status in server */
|
||||||
|
unsigned int gone:1;
|
||||||
|
unsigned int serverop:1;
|
||||||
|
|
||||||
|
/* status in channel */
|
||||||
|
unsigned int send_massjoin:1; /* Waiting to be sent in massjoin signal */
|
||||||
|
unsigned int op:1;
|
||||||
|
unsigned int halfop:1;
|
||||||
|
unsigned int voice:1;
|
||||||
|
|
||||||
|
GHashTable *module_data;
|
@ -39,6 +39,10 @@ NICK_REC *nicklist_insert(CHANNEL_REC *channel, const char *nick,
|
|||||||
|
|
||||||
rec = g_new0(NICK_REC, 1);
|
rec = g_new0(NICK_REC, 1);
|
||||||
|
|
||||||
|
MODULE_DATA_INIT(rec);
|
||||||
|
rec->type = module_get_uniq_id("NICK", 0);
|
||||||
|
rec->chat_type = channel->chat_type;
|
||||||
|
|
||||||
if (op) rec->op = TRUE;
|
if (op) rec->op = TRUE;
|
||||||
if (voice) rec->voice = TRUE;
|
if (voice) rec->voice = TRUE;
|
||||||
|
|
||||||
@ -310,4 +314,6 @@ void nicklist_deinit(void)
|
|||||||
{
|
{
|
||||||
signal_remove("channel created", (SIGNAL_FUNC) sig_channel_created);
|
signal_remove("channel created", (SIGNAL_FUNC) sig_channel_created);
|
||||||
signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
|
signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
|
||||||
|
|
||||||
|
module_uniq_destroy("NICK");
|
||||||
}
|
}
|
||||||
|
@ -4,23 +4,15 @@
|
|||||||
#include "servers.h"
|
#include "servers.h"
|
||||||
#include "channels.h"
|
#include "channels.h"
|
||||||
|
|
||||||
|
/* Returns NICK_REC if it's nick, NULL if it isn't. */
|
||||||
|
#define NICK(server) \
|
||||||
|
MODULE_CHECK_CAST(server, NICK_REC, type, "NICK")
|
||||||
|
|
||||||
|
#define IS_NICK(server) \
|
||||||
|
(NICK(server) ? TRUE : FALSE)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
time_t last_check; /* last time gone was checked */
|
#include "nick-rec.h"
|
||||||
|
|
||||||
char *nick;
|
|
||||||
char *host;
|
|
||||||
char *realname;
|
|
||||||
int hops;
|
|
||||||
|
|
||||||
/* status in server */
|
|
||||||
unsigned int gone:1;
|
|
||||||
unsigned int serverop:1;
|
|
||||||
|
|
||||||
/* status in channel */
|
|
||||||
unsigned int send_massjoin:1; /* Waiting to be sent in massjoin signal */
|
|
||||||
unsigned int op:1;
|
|
||||||
unsigned int halfop:1;
|
|
||||||
unsigned int voice:1;
|
|
||||||
} NICK_REC;
|
} NICK_REC;
|
||||||
|
|
||||||
/* Add new nick to list */
|
/* Add new nick to list */
|
||||||
|
Loading…
Reference in New Issue
Block a user