|
1 | 1 | ; WeeChat-Script to replace emotion-tags with random emoticons.
|
2 |
| -; Copyright (C) 2017 Alvar <[email protected]> |
| 2 | +; Copyright (C) 2017-2018 Alvar <[email protected]> |
3 | 3 | ;
|
4 | 4 | ; This program is free software: you can redistribute it and/or modify
|
5 | 5 | ; it under the terms of the GNU General Public License as published by
|
|
53 | 53 | (emoticonize-line new-line)
|
54 | 54 | new-line)))
|
55 | 55 |
|
56 |
| -; Pointer String String -> Weechat-Return |
| 56 | +; Pointer ? ? String -> String |
57 | 57 | ; This function was registered to be called when an input was submitted and
|
58 | 58 | ; will try to replace ~~EMOTIONs to emoticons.
|
59 |
| -(define (command-run data buffer command) |
60 |
| - (let* |
61 |
| - ((input (weechat:buffer_get_string buffer "input")) |
62 |
| - (output (emoticonize-line input))) |
63 |
| - (weechat:buffer_set buffer "input" output)) |
64 |
| - weechat:WEECHAT_RC_OK) |
| 59 | +(define (weechataboo-hook data modifier modifier-data msg) |
| 60 | + (emoticonize-line msg)) |
65 | 61 |
|
66 | 62 | ; Pointer String List -> Weechat-Return
|
67 | 63 | ; Function which tells you to RTFM.
|
|
115 | 111 |
|
116 | 112 |
|
117 | 113 | (weechat:register
|
118 |
| - "weechataboo" "Alvar" "0.1.1" "GPL3" |
| 114 | + "weechataboo" "Alvar" "0.1.2" "GPL3" |
119 | 115 | "Replace emotion-tags with random emoticons" "clean-up" "")
|
120 | 116 |
|
121 | 117 | (and (eq? (weechat:config_is_set_plugin "emotions") 0)
|
122 | 118 | (initial-setup))
|
123 | 119 |
|
124 |
| -(weechat:hook_command_run "/input return" "command-run" "") |
| 120 | +(weechat:hook_modifier "irc_out1_privmsg" "weechataboo-hook" "") |
| 121 | + |
125 | 122 | (weechat:hook_command
|
126 | 123 | "weechataboo"
|
127 | 124 | (string-append "This script automatically replaces written emotion-keywords\n"
|
|
0 commit comments