diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2017-09-03 16:56:45 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2017-09-05 17:04:08 +0200 |
commit | 4bf54a67516059b352789dc40127d099a06ffd3a (patch) | |
tree | d9f98c2151d30496a8e819c39b098fbc0a63aa60 /LICENSE | |
parent | 5608e22cdeb9ba3a07e2925fc97bb47bcbbc17da (diff) | |
download | wee-slack-4bf54a67516059b352789dc40127d099a06ffd3a.tar.gz |
Add support for sending multiline messages
While weechat plugins like multiline.pl and edit.py allow you to compose
multiline messages, wee-slack normally receives them line by line, so it
ends up as separate messages. There isn't any direct support for
receiving the complete message from weechat, but it can be done with
sort of a workaround.
There is a callback you can hook on to which allows you to intercept and
edit messages before they are sent to the buffer. This callback receives
the complete message with all the lines. By using this we can process
the whole message, and return an empty string from the callback which
means that the message will not be processed further.
Note that when this happens, weechat commands are not processed, which
is why we only use the callback for messages that contain a newline and
does not start with slash. Otherwise, we are returning the string sent
to the callback, which would be the same as the callback not being
hooked in.
I've also opened a PR in weechat for supporting multiline input
properly[0]. If that is merged, that can be used for newer weechat
versions instead of this.
[0]: https://github.com/weechat/weechat/pull/1063
Fixes #118
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions