]> jfr.im git - irc/weechat/weechat.git/commitdiff
irc: change default chantypes from "#&+!" to "#&"
authorSébastien Helleu <redacted>
Sun, 21 Jun 2020 08:21:22 +0000 (10:21 +0200)
committerSébastien Helleu <redacted>
Sun, 21 Jun 2020 08:22:04 +0000 (10:22 +0200)
The default chantypes was conflicting with
irc_server_prefix_chars_default ("@+").

ChangeLog.adoc
src/plugins/irc/irc-channel.c
src/plugins/irc/irc-channel.h
tests/unit/plugins/irc/test-irc-channel.cpp

index 77da9767562da8c5e212489c93db2ad290e7dcb0..85635d997d259e9f30667970e8a38d7ccdddda34 100644 (file)
@@ -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)
index d452a75800120b8d3c82159aedcf9e8decd40161..98d407ba4a290016fe3e5db23801a612fa4120a6 100644 (file)
 #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;
 }
 
index 5f616b5f1edf24d873d90a20d1e8a2c8e056a81f..64f05f1f0f84d517e706eb61fd760ab6725c90fe 100644 (file)
@@ -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,
index b78818987c202e746d81829063aa54b65085317b..d8a255e7d74a7fd01eec0d9d320b44847d8b1cb4 100644 (file)
@@ -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");