diff options
author | luk3yx <luk3yx@users.noreply.github.com> | 2022-05-12 19:42:20 +1200 |
---|---|---|
committer | luk3yx <luk3yx@users.noreply.github.com> | 2022-05-12 19:42:20 +1200 |
commit | a334c673b2f16cd457edebff7e0868e21194f71a (patch) | |
tree | d2b0b03968da6f92ecea129487b4d7cdcd2b16fa | |
parent | 4bd238e178a4a51eadc6711915f31455e8ca5909 (diff) | |
download | miniirc_idc-a334c673b2f16cd457edebff7e0868e21194f71a.tar.gz miniirc_idc-a334c673b2f16cd457edebff7e0868e21194f71a.zip |
Proxy newlines as separate messages for now
-rwxr-xr-x | idc_irc_proxy.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/idc_irc_proxy.py b/idc_irc_proxy.py index 5068f8c..d946fe1 100755 --- a/idc_irc_proxy.py +++ b/idc_irc_proxy.py @@ -86,6 +86,15 @@ class Proxy: if not args or not args[-1].startswith('proxy:'): return args = [args[0], args[-1][6:]] + elif cmd == 'PRIVMSG' and ('\n' in args[-1] or '\r' in args[-1]): + message = args[-1].replace('\r\n', '\n').replace('\r', '\n') + for i, line in enumerate(message.split('\n', 9)): + if i > 0: + line = '\u200b' + line + self.send(cmd, hostmask, tags, [args[0], line]) + if i == 0: + tags = {} + return # Send the command to the client try: |