summaryrefslogtreecommitdiff
path: root/plugins/degesch
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/degesch')
-rw-r--r--plugins/degesch/slack.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/degesch/slack.lua b/plugins/degesch/slack.lua
index 79f5d88..89f0adf 100644
--- a/plugins/degesch/slack.lua
+++ b/plugins/degesch/slack.lua
@@ -48,6 +48,31 @@ degesch.hook_irc (function (hook, server, line)
.. msg.prefix:match "^[^!@]*" .. " :" .. text
end)
+-- Unfuck :nick!nick@irc.tinyspeck.com MODE #channel +v nick : active
+degesch.hook_irc (function (hook, server, line)
+ if not servers[server.name] then return line end
+ return line:gsub ("^(:%S+ MODE .+) : .*", "%1")
+end)
+
+-- The gateway simply ignores the NAMES command altogether
+degesch.hook_input (function (hook, buffer, input)
+ if not buffer.channel or not servers[buffer.server.name]
+ or not input:match "^/names%s*" then return input end
+
+ local users = buffer.channel.users
+ table.sort (users, function (a, b)
+ if a.prefixes > b.prefixes then return true end
+ if a.prefixes < b.prefixes then return false end
+ return a.user.nickname < b.user.nickname
+ end)
+
+ local names = "Users on " .. buffer.channel.name .. ":"
+ for i, chan_user in ipairs (users) do
+ names = names .. " " .. chan_user.prefixes .. chan_user.user.nickname
+ end
+ buffer:log (names)
+end)
+
degesch.hook_completion (function (hook, data, word)
local chan = degesch.current_buffer.channel
local server = degesch.current_buffer.server