summaryrefslogtreecommitdiff
path: root/irc
diff options
context:
space:
mode:
authorrebecca <ubq323@ubq323.website>2026-09-24 17:20:42 +0100
committerrebecca <ubq323@ubq323.website>2026-09-24 18:55:05 +0100
commit71cee0014368f5d83fe94989526a4ffb2824f50c (patch)
treecd87a5c7d859d98f48866ff769ef89d60a28d5d5 /irc
parentdff5363f96029aba6d0f222d3e31ab3888d7111f (diff)
change fields on Message to include author
Diffstat (limited to 'irc')
-rw-r--r--irc/pylon.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/irc/pylon.lua b/irc/pylon.lua
index 039ec38..1be3ab2 100644
--- a/irc/pylon.lua
+++ b/irc/pylon.lua
@@ -34,10 +34,11 @@ function Irc.recving(self)
local channel_name = msg.args[1]
local body = msg.args[2]
local sender = msg.source
- self.wilson:deliver({
- source_channel = Thing(self, channel_name),
+ self.wilson:deliver(Message {
+ pylon = self,
+ channel = Thing(self, channel_name),
+ author = Thing(self, sender),
body = body,
- sender = sender,
})
elseif msg.op == 'ERROR' then
error(msg.args[1])
@@ -65,7 +66,7 @@ function Irc.sending(self)
say('WILSON', '#test', 'i am wilson')
for dest_channel, message in self.inbox:iter() do
- local nick = message.sender.."["..message.source_channel.pylon.shortname.."]"
+ local nick = message.author:name_with_shortname()
local channel_name = dest_channel.id
say(nick, channel_name, message.body)
end