-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encode decode from server is misordered #661
Conversation
Message decoding must be done on the whole message. Protocol commands and control delimiters are all ascii subset of utf-8 and every data from the server (like nickname, user ident, and server name) are subject to charset encodings, so no need to focus only on text data part. Also, it has been detected that server data on output is first encoded as a message and then charset converted. This must happen in reverse direction (first decoded, then parsed) on input, and message fields are first extracted from message (to dynamic memory) and then the message is converted (so message already extracted parameters are not charset decoded) This is wrong. Message decoding is being moved to first place (even before raw printing)
The decoding code has ben moved to the beginning of the input processing code. In this way, we first decode the message and then extract the info, not as was being done before, that we extracted the info to dynamically allocated strings and then did the decoding of the original message (this lead to confusion on nicks channels with non ascii characters) This tried to be solved by trying to decode/encode only parts of the message which is incorrect, so we have undone that modifications.
Cannot use channel or nick if we have to decode server messages before we have decoded the destination channel or nick they are directed to.
irc.network.channel_encode parameter is no longer necessary due to how are messages decoded from a server using a charset for nick-names and domain part in masks.
src/plugins/irc/irc-server.c
Outdated
weechat_plugin->name, | ||
server->name, | ||
ptr_chan_nick); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The then part of this if should be eliminated to be consistent with the decode part (not using nick/channel part in modifier) I should eliminate from line 2100 to 2109 (both inclusive)
encode is inconsistent in modifier, which users <plugin_name>.<server_name>.<channel_or_nick> when charset dependant of nick has been disabled. Now use only <plugin_name>.<server_name> as modifier for encoding.
What to do now? a bad checksum in an apt-get is condition sufficient for a patch to be rejected? Will CI system recompile it again? Have I to upload a new commit? Thanks in advance |
@mojadita : of course this is an issue on Travis side, I'll run the test again. |
Thanks!!! |
I think the patch is ready for your consideration. I have run it locally and everything seems to work nice. |
Applying this patch I can see correctly the iso-8859-15 encoded hostnames (issue #482) |
Sorry, I did a rebase to master and the old branch must be deleted.
Now the patch I think is correct.