Changeset

185:4f897d0e01c4

plugins.groupchat: Trying to get subject to behave properly
author Kim Alvefur <zash@zash.se>
date Wed, 19 Jan 2011 20:37:12 +0100
parents 184:8173e57522bf
children 186:bb34b8bc00ae
files plugins/groupchat.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/groupchat.lua	Thu Jan 13 00:23:17 2011 +0100
+++ b/plugins/groupchat.lua	Wed Jan 19 20:37:12 2011 +0100
@@ -38,7 +38,7 @@
 		end
 		local room = setmetatable({
 			stream = stream, jid = jid, nick = nick,
-			subject = "",
+			subject = nil,
 			occupants = {},
 			events = events.new()
 		}, room_mt);
@@ -80,8 +80,9 @@
 		end);
 		room:hook("message", function(msg)
 			local subject = msg.stanza:get_child("subject");
+			subject = subject and subject:get_text();
 			if subject then
-				room.subject = subject and subject:get_text() or "";
+				room.subject = #subject > 0 and subject or nil;
 			end
 		end);
 		local join_st = st.presence({to = jid.."/"..nick})