Reply to messages with the same (the incoming) message type

Thu, 20 May 2010 14:33:09 +0100

author
Chris <jugg@hotmail.com>
date
Thu, 20 May 2010 14:33:09 +0100
changeset 15
22e6c003a83a
parent 14
3df63aaba9e3
child 16
ae69cea97598

Reply to messages with the same (the incoming) message type

init.lua file | annotate | diff | comparison | revisions
--- a/init.lua	Thu May 20 14:32:21 2010 +0100
+++ b/init.lua	Thu May 20 14:33:09 2010 +0100
@@ -30,7 +30,7 @@
 				function event:reply(reply)
 					if replied then return false; end
 					replied = true;
-					return bot:send_message(stanza.attr.from, reply);
+					return bot:send_message(stanza.attr.from, stanza.attr.type, reply);
 				end
 			end
 			local ret;
@@ -67,8 +67,8 @@
 	return self.stream:hook("bot/"..name, ...);
 end
 
-function riddim_mt:send_message(to, text, formatted_text)
-	self:send(st.message({ to = to, type = "chat" }):tag("body"):text(text));
+function riddim_mt:send_message(to, type, text)
+	self:send(st.message({ to = to, type = type }):tag("body"):text(text));
 end
 
 function riddim_mt:add_plugin(name)

mercurial