diff --git a/src/core/modules.c b/src/core/modules.c index 38c33dea..a8860be6 100644 --- a/src/core/modules.c +++ b/src/core/modules.c @@ -28,7 +28,7 @@ static GHashTable *uniqids, *uniqstrids; static GHashTable *idlookup, *stridlookup; static int next_uniq_id; -void *module_check_cast(void *object, int type_pos, const char *id) +const void *module_check_cast(const void *object, int type_pos, const char *id) { return object == NULL || module_find_id(id, G_STRUCT_MEMBER(int, object, type_pos)) == -1 ? NULL : object; diff --git a/src/core/modules.h b/src/core/modules.h index 1e707c0c..9ae906b7 100644 --- a/src/core/modules.h +++ b/src/core/modules.h @@ -74,7 +74,7 @@ MODULE_FILE_REC *module_file_find(MODULE_REC *module, const char *name); #define MODULE_CHECK_CAST_MODULE(object, cast, type_field, module, id) \ ((cast *) module_check_cast_module(object, \ offsetof(cast, type_field), module, id)) -void *module_check_cast(void *object, int type_pos, const char *id); +const void *module_check_cast(const void *object, int type_pos, const char *id); void *module_check_cast_module(void *object, int type_pos, const char *module, const char *id); diff --git a/src/core/recode.c b/src/core/recode.c index 7185dd99..120d0783 100644 --- a/src/core/recode.c +++ b/src/core/recode.c @@ -25,6 +25,9 @@ #include #include +#include +#include + static char *translit_charset; static gboolean term_is_utf8; @@ -65,6 +68,22 @@ static char *find_conversion(const SERVER_REC *server, const char *target) { char *conv = NULL; + if (IS_IRC_SERVER(server)) + { + IRC_SERVER_REC *irc_server = (IRC_SERVER_REC *) server; + if (g_hash_table_lookup(irc_server->isupport, "utf8only")) + { + /* "Clients implementing this specification MUST NOT send non-UTF-8 + * data to the server once they have seen this token." + * "If a client implementing this specification sees this token, + * they MUST set their outgoing encoding to UTF-8 without requiring + * any user intervention." + * -- https://ircv3.net/specs/extensions/utf8-only + */ + return NULL; + } + } + if (server != NULL && target != NULL) { char *tagtarget = g_strdup_printf("%s/%s", server->tag, target); conv = iconfig_get_str("conversions", tagtarget, NULL);