mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 15:25:42 +02:00
Added/renamed some files, many changes in IRC sources for running as plugin (still under development)
This commit is contained in:
@@ -14,12 +14,15 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
SET(LIB_IRC_SRC irc.h irc-commands.c irc-send.c irc-recv.c irc-server.c
|
||||
irc-channel.c irc-nick.c irc-mode.c irc-dcc.c irc-ignore.c irc-display.c)
|
||||
SET(LIB_PROTOCOL_IRC_SRC irc.h irc-buffer.c irc-buffer.h irc-channel.c
|
||||
irc-channel.h irc-command.c irc-command.h irc-color.c irc-color.h irc-config.c
|
||||
irc-config.h irc-core.c irc-dcc.c irc-dcc.h irc-display.c irc-input.c irc-log.c
|
||||
irc-mode.c irc-nick.c irc-nick.h irc-protocol.c irc-protocol.h irc-server.c
|
||||
irc-server.h)
|
||||
|
||||
CHECK_INCLUDE_FILES("regex.h" HAVE_REGEX_H)
|
||||
CHECK_FUNCTION_EXISTS(regexec HAVE_REGEXEC)
|
||||
CHECK_FUNCTION_EXISTS(uname HAVE_UNAME)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
|
||||
ADD_LIBRARY(weechat_irc STATIC ${LIB_IRC_SRC})
|
||||
ADD_LIBRARY(weechat_protocol_irc STATIC ${LIB_PROTOCOL_IRC_SRC})
|
||||
|
||||
+29
-12
@@ -16,16 +16,33 @@
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GNUTLS_CFLAGS)
|
||||
|
||||
noinst_LIBRARIES = lib_weechat_irc.a
|
||||
libdir = ${weechat_libdir}/plugins
|
||||
|
||||
lib_weechat_irc_a_SOURCES = irc.h \
|
||||
irc-commands.c \
|
||||
irc-send.c \
|
||||
irc-recv.c \
|
||||
irc-server.c \
|
||||
irc-channel.c \
|
||||
irc-nick.c \
|
||||
irc-mode.c \
|
||||
irc-dcc.c \
|
||||
irc-ignore.c \
|
||||
irc-display.c
|
||||
lib_LTLIBRARIES = irc.la
|
||||
|
||||
irc_la_SOURCES = irc.h \
|
||||
irc-buffer.c \
|
||||
irc-buffer.h \
|
||||
irc-channel.c \
|
||||
irc-channel.h \
|
||||
irc-command.c \
|
||||
irc-command.h \
|
||||
irc-color.c \
|
||||
irc-color.h \
|
||||
irc-config.c \
|
||||
irc-config.h \
|
||||
irc-core.c \
|
||||
irc-dcc.c \
|
||||
irc-dcc.h \
|
||||
irc-display.c \
|
||||
irc-input.c \
|
||||
irc-log.c \
|
||||
irc-mode.c \
|
||||
irc-nick.c \
|
||||
irc-nick.h \
|
||||
irc-protocol.c \
|
||||
irc-protocol.h \
|
||||
irc-server.c \
|
||||
irc-server.h
|
||||
irc_la_LDFLAGS = -module
|
||||
irc_la_LIBADD = $(GNUTLS_LFLAGS)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_IRC_BUFFER_H
|
||||
#define __WEECHAT_IRC_BUFFER_H 1
|
||||
|
||||
#include "irc-server.h"
|
||||
#include "irc-channel.h"
|
||||
|
||||
#define IRC_BUFFER_SERVER(buffer) (((t_irc_buffer_data *)(buffer->protocol_data))->server)
|
||||
#define IRC_BUFFER_CHANNEL(buffer) (((t_irc_buffer_data *)(buffer->protocol_data))->channel)
|
||||
#define IRC_BUFFER_ALL_SERVERS(buffer) (((t_irc_buffer_data *)(buffer->protocol_data))->all_servers)
|
||||
|
||||
#define IRC_BUFFER_GET_SERVER(buffer) \
|
||||
t_irc_server *ptr_server = IRC_BUFFER_SERVER(buffer)
|
||||
#define IRC_BUFFER_GET_CHANNEL(buffer) \
|
||||
t_irc_channel *ptr_channel = IRC_BUFFER_CHANNEL(buffer)
|
||||
#define IRC_BUFFER_GET_SERVER_CHANNEL(buffer) \
|
||||
t_irc_server *ptr_server = IRC_BUFFER_SERVER(buffer); \
|
||||
t_irc_channel *ptr_channel = IRC_BUFFER_CHANNEL(buffer)
|
||||
|
||||
/* protocol data for GUI buffers */
|
||||
|
||||
typedef struct t_irc_buffer_data t_irc_buffer_data;
|
||||
|
||||
struct t_irc_buffer_data
|
||||
{
|
||||
t_irc_server *server;
|
||||
t_irc_channel *channel;
|
||||
int all_servers;
|
||||
};
|
||||
|
||||
#endif /* irc-buffer.h */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_IRC_CHANNEL_H
|
||||
#define __WEECHAT_IRC_CHANNEL_H 1
|
||||
|
||||
#include "irc-nick.h"
|
||||
#include "../../gui/gui.h"
|
||||
|
||||
#define IRC_CHANNEL_PREFIX "#&+!"
|
||||
|
||||
/* channel types */
|
||||
#define IRC_CHANNEL_TYPE_UNKNOWN -1
|
||||
#define IRC_CHANNEL_TYPE_CHANNEL 0
|
||||
#define IRC_CHANNEL_TYPE_PRIVATE 1
|
||||
#define IRC_CHANNEL_TYPE_DCC_CHAT 2
|
||||
|
||||
#define IRC_CHANNEL_NICKS_SPEAKING_LIMIT 32
|
||||
|
||||
typedef struct t_irc_channel t_irc_channel;
|
||||
|
||||
struct t_irc_channel
|
||||
{
|
||||
int type; /* channel type */
|
||||
void *dcc_chat; /* DCC CHAT pointer (NULL if not DCC) */
|
||||
char *name; /* name of channel (exemple: "#abc") */
|
||||
char *topic; /* topic of channel (host for private) */
|
||||
char *modes; /* channel modes */
|
||||
int limit; /* user limit (0 is limit not set) */
|
||||
char *key; /* channel key (NULL if no key is set) */
|
||||
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
|
||||
int checking_away; /* = 1 if checking away with WHO cmd */
|
||||
char *away_message; /* to display away only once in private */
|
||||
int cycle; /* currently cycling (/part then /join) */
|
||||
int close; /* close request (/buffer close) */
|
||||
int display_creation_date; /* 1 if creation date should be displayed*/
|
||||
int nick_completion_reset; /* 1 if nick completion should be rebuilt*/
|
||||
/* there was some join/part on channel */
|
||||
t_irc_nick *nicks; /* nicks on the channel */
|
||||
t_irc_nick *last_nick; /* last nick on the channel */
|
||||
t_weelist *nicks_speaking; /* nicks speaking (for smart completion) */
|
||||
t_weelist *last_nick_speaking; /* last nick speaking */
|
||||
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
|
||||
t_irc_channel *prev_channel; /* link to previous channel */
|
||||
t_irc_channel *next_channel; /* link to next channel */
|
||||
};
|
||||
|
||||
#endif /* irc-channel.h */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_IRC_COLOR_H
|
||||
#define __WEECHAT_IRC_COLOR_H 1
|
||||
|
||||
/* shift ncurses colors for compatibility with colors
|
||||
in IRC messages (same as other IRC clients) */
|
||||
|
||||
#define WEECHAT_COLOR_BLACK COLOR_BLACK
|
||||
#define WEECHAT_COLOR_RED COLOR_BLUE
|
||||
#define WEECHAT_COLOR_GREEN COLOR_GREEN
|
||||
#define WEECHAT_COLOR_YELLOW COLOR_CYAN
|
||||
#define WEECHAT_COLOR_BLUE COLOR_RED
|
||||
#define WEECHAT_COLOR_MAGENTA COLOR_MAGENTA
|
||||
#define WEECHAT_COLOR_CYAN COLOR_YELLOW
|
||||
#define WEECHAT_COLOR_WHITE COLOR_WHITE
|
||||
|
||||
/* attributes in IRC messages for color & style (bold, ..) */
|
||||
|
||||
#define IRC_COLOR_BOLD_CHAR '\x02'
|
||||
#define IRC_COLOR_BOLD_STR "\x02"
|
||||
#define IRC_COLOR_COLOR_CHAR '\x03'
|
||||
#define IRC_COLOR_COLOR_STR "\x03"
|
||||
#define IRC_COLOR_RESET_CHAR '\x0F'
|
||||
#define IRC_COLOR_RESET_STR "\x0F"
|
||||
#define IRC_COLOR_FIXED_CHAR '\x11'
|
||||
#define IRC_COLOR_FIXED_STR "\x11"
|
||||
#define IRC_COLOR_REVERSE_CHAR '\x12'
|
||||
#define IRC_COLOR_REVERSE_STR "\x12"
|
||||
#define IRC_COLOR_REVERSE2_CHAR '\x16'
|
||||
#define IRC_COLOR_REVERSE2_STR "\x16"
|
||||
#define IRC_COLOR_ITALIC_CHAR '\x1D'
|
||||
#define IRC_COLOR_ITALIC_STR "\x1D"
|
||||
#define IRC_COLOR_UNDERLINE_CHAR '\x1F'
|
||||
#define IRC_COLOR_UNDERLINE_STR "\x1F"
|
||||
|
||||
#endif /* irc-color.h */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_IRC_COMMAND_H
|
||||
#define __WEECHAT_IRC_COMMAND_H 1
|
||||
|
||||
#include "../../core/command.h"
|
||||
|
||||
extern t_weechat_command irc_commands[];
|
||||
|
||||
extern int irc_cmd_admin (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_ame (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_amsg (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_away (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_ban (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_connect (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_ctcp (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_cycle (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_dcc (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_dehalfop (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_deop (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_devoice (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_die (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_disconnect (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_halfop (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_info (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_invite (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_ison (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_join (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_kick (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_kickban (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_kill (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_links (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_list (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_lusers (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_me (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_mode (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_motd (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_msg (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_msg (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_names (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_nick (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_notice (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_op (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_oper (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_part (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_ping (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_pong (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_query (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_quit (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_quote (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_reconnect (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_rehash (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_restart (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_service (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_server (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_servlist (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_squery (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_squit (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_stats (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_summon (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_time (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_topic (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_trace (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_unban (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_userhost (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_users (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_version (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_voice (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_wallops (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_who (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_whois (t_gui_window *, char *, int, char **);
|
||||
extern int irc_cmd_whowas (t_gui_window *, char *, int, char **);
|
||||
|
||||
#endif /* irc-command.h */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_IRC_CONFIG_H
|
||||
#define __WEECHAT_IRC_CONFIG_H 1
|
||||
|
||||
#include "../../core/config-option.h"
|
||||
|
||||
#define IRC_CONFIG_NAME "irc.rc"
|
||||
|
||||
#define CFG_IRC_DISPLAY_AWAY_OFF 0
|
||||
#define CFG_IRC_DISPLAY_AWAY_LOCAL 1
|
||||
#define CFG_IRC_DISPLAY_AWAY_CHANNEL 2
|
||||
|
||||
extern int irc_cfg_irc_one_server_buffer;
|
||||
extern int irc_cfg_irc_open_near_server;
|
||||
extern char *irc_cfg_irc_nick_prefix;
|
||||
extern char *irc_cfg_irc_nick_suffix;
|
||||
extern int irc_cfg_irc_display_away;
|
||||
extern int irc_cfg_irc_show_away_once;
|
||||
extern char *irc_cfg_irc_default_msg_part;
|
||||
extern char *irc_cfg_irc_default_msg_quit;
|
||||
extern int irc_cfg_irc_notice_as_pv;
|
||||
extern int irc_cfg_irc_away_check;
|
||||
extern int irc_cfg_irc_away_check_max_nicks;
|
||||
extern int irc_cfg_irc_lag_check;
|
||||
extern int irc_cfg_irc_lag_min_show;
|
||||
extern int irc_cfg_irc_lag_disconnect;
|
||||
extern int irc_cfg_irc_anti_flood;
|
||||
extern char *irc_cfg_irc_highlight;
|
||||
extern int irc_cfg_irc_colors_receive;
|
||||
extern int irc_cfg_irc_colors_send;
|
||||
extern int irc_cfg_irc_send_unknown_commands;
|
||||
|
||||
extern int irc_cfg_dcc_auto_accept_files;
|
||||
extern int irc_cfg_dcc_auto_accept_chats;
|
||||
extern int irc_cfg_dcc_timeout;
|
||||
extern int irc_cfg_dcc_blocksize;
|
||||
extern int irc_cfg_dcc_fast_send;
|
||||
extern char *irc_cfg_dcc_port_range;
|
||||
extern char *irc_cfg_dcc_own_ip;
|
||||
extern char *irc_cfg_dcc_download_path;
|
||||
extern char *irc_cfg_dcc_upload_path;
|
||||
extern int irc_cfg_dcc_convert_spaces;
|
||||
extern int irc_cfg_dcc_auto_rename;
|
||||
extern int irc_cfg_dcc_auto_resume;
|
||||
|
||||
extern int irc_cfg_log_auto_server;
|
||||
extern int irc_cfg_log_auto_channel;
|
||||
extern int irc_cfg_log_auto_private;
|
||||
extern int irc_cfg_log_hide_nickserv_pwd;
|
||||
|
||||
extern void irc_config_change_noop ();
|
||||
extern void irc_config_change_one_server_buffer ();
|
||||
extern void irc_config_change_away_check ();
|
||||
extern void irc_config_change_log ();
|
||||
extern void irc_config_change_notify_levels ();
|
||||
extern int irc_config_read_server (t_config_option *, char *, char *);
|
||||
extern int irc_config_read ();
|
||||
extern int irc_config_write_servers (FILE *, char *, t_config_option *);
|
||||
extern int irc_config_write_servers_default_values (FILE *, char *,
|
||||
t_config_option *);
|
||||
extern int irc_config_write ();
|
||||
|
||||
#endif /* irc-config.h */
|
||||
File diff suppressed because it is too large
Load Diff
+283
-293
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+178
-224
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -26,9 +26,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
#include "../../core/weechat.h"
|
||||
#include "irc.h"
|
||||
#include "../../common/util.h"
|
||||
#include "../../core/util.h"
|
||||
#include "../../gui/gui.h"
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ irc_mode_channel_set_nick (t_irc_channel *channel, char *nick,
|
||||
char set_flag, int flag)
|
||||
{
|
||||
t_irc_nick *ptr_nick;
|
||||
t_gui_nick *ptr_gui_nick;
|
||||
int sort_index, color_prefix;
|
||||
char prefix;
|
||||
|
||||
if (nick)
|
||||
{
|
||||
@@ -48,8 +51,19 @@ irc_mode_channel_set_nick (t_irc_channel *channel, char *nick,
|
||||
if (ptr_nick)
|
||||
{
|
||||
IRC_NICK_SET_FLAG(ptr_nick, (set_flag == '+'), flag);
|
||||
irc_nick_resort (channel, ptr_nick);
|
||||
gui_nicklist_draw (channel->buffer, 1, 1);
|
||||
ptr_gui_nick = gui_nicklist_search (channel->buffer,
|
||||
ptr_nick->nick);
|
||||
if (ptr_gui_nick)
|
||||
{
|
||||
irc_nick_get_gui_infos (ptr_nick, &sort_index, &prefix,
|
||||
&color_prefix);
|
||||
gui_nicklist_update (channel->buffer, ptr_gui_nick, NULL,
|
||||
sort_index,
|
||||
ptr_gui_nick->color_nick,
|
||||
prefix,
|
||||
color_prefix);
|
||||
gui_nicklist_draw (channel->buffer, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,7 +111,7 @@ irc_mode_channel_set (t_irc_server *server, t_irc_channel *channel,
|
||||
pos_args++;
|
||||
while (pos_args[0] == ' ')
|
||||
pos_args++;
|
||||
argv = explode_string (pos_args, " ", 0, &argc);
|
||||
argv = weechat_explode_string (pos_args, " ", 0, &argc);
|
||||
if (argc > 0)
|
||||
current_arg = argc - 1;
|
||||
}
|
||||
@@ -198,7 +212,7 @@ irc_mode_channel_set (t_irc_server *server, t_irc_channel *channel,
|
||||
}
|
||||
|
||||
if (argv)
|
||||
free_exploded_string (argv);
|
||||
weechat_free_exploded_string (argv);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -309,7 +323,7 @@ irc_mode_nick_prefix_allowed (t_irc_server *server, char prefix)
|
||||
{
|
||||
str[0] = prefix;
|
||||
str[1] = '\0';
|
||||
return (strpbrk (str, IRC_DEFAULT_PREFIXES_LIST)) ? 1 : 0;
|
||||
return (strpbrk (str, IRC_NICK_DEFAULT_PREFIXES_LIST)) ? 1 : 0;
|
||||
}
|
||||
|
||||
return (strchr (server->prefix, prefix) != NULL);
|
||||
|
||||
+117
-170
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_IRC_NICK_H
|
||||
#define __WEECHAT_IRC_NICK_H 1
|
||||
|
||||
#define IRC_NICK_DEFAULT_PREFIXES_LIST "@%+~&!-"
|
||||
|
||||
#define IRC_NICK_CHANOWNER 1
|
||||
#define IRC_NICK_CHANADMIN 2
|
||||
#define IRC_NICK_OP 4
|
||||
#define IRC_NICK_HALFOP 8
|
||||
#define IRC_NICK_VOICE 16
|
||||
#define IRC_NICK_AWAY 32
|
||||
#define IRC_NICK_CHANADMIN2 64
|
||||
#define IRC_NICK_CHANUSER 128
|
||||
#define IRC_NICK_SET_FLAG(nick, set, flag) \
|
||||
if (set) \
|
||||
nick->flags |= flag; \
|
||||
else \
|
||||
nick->flags &= 0xFFFF - flag;
|
||||
|
||||
typedef struct t_irc_nick t_irc_nick;
|
||||
|
||||
struct t_irc_nick
|
||||
{
|
||||
char *nick; /* nickname */
|
||||
char *host; /* full hostname */
|
||||
int flags; /* chanowner/chanadmin (unrealircd), */
|
||||
/* op, halfop, voice, away */
|
||||
int color; /* color for nickname in chat window */
|
||||
t_irc_nick *prev_nick; /* link to previous nick on the channel */
|
||||
t_irc_nick *next_nick; /* link to next nick on the channel */
|
||||
};
|
||||
|
||||
#endif /* irc-nick.h */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_IRC_PROTOCOL_H
|
||||
#define __WEECHAT_IRC_PROTOCOL_H 1
|
||||
|
||||
typedef int (t_irc_recv_func)(t_irc_server *, char *, char *, char *, char *,
|
||||
int, int);
|
||||
|
||||
typedef struct t_irc_protocol_msg t_irc_protocol_msg;
|
||||
|
||||
struct t_irc_protocol_msg
|
||||
{
|
||||
char *name; /* IRC message name */
|
||||
char *description; /* message description */
|
||||
t_irc_recv_func *recv_function; /* function called when msg is received */
|
||||
};
|
||||
|
||||
#endif /* irc-protocol.h */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+350
-181
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+222
-519
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user