Changeset

252:7b36e4038377

verse.plugins.groupchat: Make last commit (7802a048) more concise
author Matthew Wild <mwild1@gmail.com>
date Sat, 03 Dec 2011 16:27:36 +0000
parents 251:e44ddcd84234
children 255:be126fe7c4e7
files plugins/groupchat.lua
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/groupchat.lua	Fri Dec 02 11:27:38 2011 +0600
+++ b/plugins/groupchat.lua	Sat Dec 03 16:27:36 2011 +0000
@@ -145,13 +145,10 @@
 end
 
 function room_mt:leave(message)
-	local presence = nil;
 	self.stream:event("groupchat/leaving", self);
+	local presence = verse.presence({type="unavailable"});
 	if message then
-		presence = verse.presence({type="unavailable"}):tag("status"):text(message);
-	else
-		presence = verse.presence({type="unavailable"});
-	end
+		presence:tag("status"):text(message);
 	self:send(presence);
 end