# HG changeset patch # User Kim Alvefur # Date 1295465832 -3600 # Node ID 4f897d0e01c43e72b92ba0df90e3467971bde9f6 # Parent 8173e57522bf9849e76d1cc57fd1cc69d9676576 plugins.groupchat: Trying to get subject to behave properly diff -r 8173e57522bf -r 4f897d0e01c4 plugins/groupchat.lua --- 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})