summaryrefslogtreecommitdiff
path: root/src/irc/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc/core')
-rw-r--r--src/irc/core/irc.c36
-rw-r--r--src/irc/core/irc.h6
2 files changed, 1 insertions, 41 deletions
diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c
index 7af48fe2..e3ba24a2 100644
--- a/src/irc/core/irc.c
+++ b/src/irc/core/irc.c
@@ -377,44 +377,8 @@ static void irc_init_server(IRC_SERVER_REC *server)
(GInputFunction) irc_parse_incoming, server);
}
-#define isoptchan(a) \
- (ischannel((a)[0]) || ((a)[0] == '*' && ((a)[1] == '\0' || (a)[1] == ' ')))
-
-static char *irc_cmd_get_func(const char *data, int *count, va_list *vargs)
-{
- IRC_CHANNEL_REC *channel;
- char *ret, *args, *chan, *p;
-
- if ((*count & PARAM_FLAG_OPTCHAN) == 0)
- return g_strdup(data);
-
- *count &= ~PARAM_FLAG_OPTCHAN;
- channel = (void *) va_arg(*vargs, void *);
- channel = IRC_CHANNEL(channel);
-
- /* change first argument in data to full channel name. */
- p = args = g_strdup(data);
-
- chan = isoptchan(args) ? cmd_get_param(&args) : NULL;
- if (chan != NULL && *chan == '!' && channel != NULL) {
- /* whenever trying to send something to !channel,
- change it to the real joined !XXXXXchannel */
- channel = irc_channel_find(channel->server, chan);
- if (channel != NULL) chan = channel->name;
- }
-
- if (chan == NULL || strcmp(chan, "*") == 0)
- chan = channel == NULL ? "*" : channel->name;
-
- ret = g_strconcat(chan, " ", args, NULL);
- g_free(p);
- return ret;
-}
-
void irc_irc_init(void)
{
- cmd_get_add_func(irc_cmd_get_func);
-
signal_add("server event", (SIGNAL_FUNC) irc_server_event);
signal_add("server connected", (SIGNAL_FUNC) irc_init_server);
signal_add("server incoming", (SIGNAL_FUNC) irc_parse_incoming_line);
diff --git a/src/irc/core/irc.h b/src/irc/core/irc.h
index c4e4ed10..17a18635 100644
--- a/src/irc/core/irc.h
+++ b/src/irc/core/irc.h
@@ -50,12 +50,8 @@ void irc_send_cmd_now(IRC_SERVER_REC *server, const char *cmd);
void irc_send_cmd_full(IRC_SERVER_REC *server, const char *cmd,
int send_now, int immediate, int raw);
-#include "commands.h" /* contains the generic PARAM_FLAG_xxx defines */
-
-/* IRC specific: optional channel in first argument */
-#define PARAM_FLAG_OPTCHAN 0x10000000
-
/* Get count parameters from data */
+#include "commands.h"
char *event_get_param(char **data);
char *event_get_params(const char *data, int count, ...);