summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-06-21 10:21:22 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-06-21 10:22:04 +0200
commit4a42cda3a5f5b02d8ba9afae129499c26250d334 (patch)
treeafa7b2b9988dcfe89321d5653fa4c0fccadd72ce
parent944661045252f38b08e1da32904317370b36cf74 (diff)
downloadweechat-4a42cda3a5f5b02d8ba9afae129499c26250d334.zip
irc: change default chantypes from "#&+!" to "#&"
The default chantypes was conflicting with irc_server_prefix_chars_default ("@+").
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/plugins/irc/irc-channel.c6
-rw-r--r--src/plugins/irc/irc-channel.h4
-rw-r--r--tests/unit/plugins/irc/test-irc-channel.cpp4
4 files changed, 8 insertions, 7 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 77da97675..85635d997 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -65,6 +65,7 @@ Bug fixes::
* exec: fix use of same task id for different tasks (issue #1491)
* fifo: fix errors when writing in the FIFO pipe (issue #713)
* guile: enable again /guile eval (issue #1514)
+ * irc: use new default chantypes "#&" when the server does not send it
* irc: add support of optional server in info "irc_is_nick", fix check of nick using UTF8MAPPING isupport value (issue #1528)
* irc: fix add of ignore with flags in regex, display full ignore mask in list of ignores (issue #1518)
* irc: do not remove spaces at the end of users messages received (issue #1513)
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index d452a7580..98d407ba4 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -40,6 +40,10 @@
#include "irc-input.h"
+/* default CHANTYPES */
+char *irc_channel_default_chantypes = "#&";
+
+
/*
* Checks if a channel pointer is valid for a server.
*
@@ -671,7 +675,7 @@ irc_channel_is_channel (struct t_irc_server *server, const char *string)
first_char[1] = '\0';
return (strpbrk (first_char,
(server && server->chantypes) ?
- server->chantypes : IRC_CHANNEL_DEFAULT_CHANTYPES)) ?
+ server->chantypes : irc_channel_default_chantypes)) ?
1 : 0;
}
diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h
index 5f616b5f1..64f05f1f0 100644
--- a/src/plugins/irc/irc-channel.h
+++ b/src/plugins/irc/irc-channel.h
@@ -22,8 +22,6 @@
#include <time.h>
-#define IRC_CHANNEL_DEFAULT_CHANTYPES "#&+!"
-
/* channel types */
#define IRC_CHANNEL_TYPE_UNKNOWN -1
#define IRC_CHANNEL_TYPE_CHANNEL 0
@@ -81,6 +79,8 @@ struct t_irc_channel
struct t_irc_channel *next_channel; /* link to next channel */
};
+extern char *irc_channel_default_chantypes;
+
extern int irc_channel_valid (struct t_irc_server *server,
struct t_irc_channel *channel);
extern struct t_irc_channel *irc_channel_search (struct t_irc_server *server,
diff --git a/tests/unit/plugins/irc/test-irc-channel.cpp b/tests/unit/plugins/irc/test-irc-channel.cpp
index b78818987..d8a255e7d 100644
--- a/tests/unit/plugins/irc/test-irc-channel.cpp
+++ b/tests/unit/plugins/irc/test-irc-channel.cpp
@@ -67,10 +67,6 @@ TEST(IrcChannel, IsChannel)
LONGS_EQUAL(1, irc_channel_is_channel (NULL, "##abc"));
LONGS_EQUAL(1, irc_channel_is_channel (NULL, "&abc"));
LONGS_EQUAL(1, irc_channel_is_channel (NULL, "&&abc"));
- LONGS_EQUAL(1, irc_channel_is_channel (NULL, "+abc"));
- LONGS_EQUAL(1, irc_channel_is_channel (NULL, "++abc"));
- LONGS_EQUAL(1, irc_channel_is_channel (NULL, "!abc"));
- LONGS_EQUAL(1, irc_channel_is_channel (NULL, "!!abc"));
/* server with chantypes = "#" */
server = irc_server_alloc ("my_ircd");