From 4341ffc0b6295a325cfe426d0f892011288c3b9e Mon Sep 17 00:00:00 2001
From: Waqas Hussain <waqas20@gmail.com>
Date: Mon, 14 May 2012 02:42:42 +0500
Subject: MUC: Fix check for history length update.

---
 plugins/muc/muc.lib.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'plugins')

diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 556916f2..31e6809f 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -676,8 +676,8 @@ function room_mt:process_form(origin, stanza)
 	dirty = dirty or (self:get_changesubject() ~= (not changesubject and true or nil))
 	module:log('debug', 'changesubject=%s', changesubject and "true" or "false")
 
-	local historylength = fields['muc#roomconfig_historylength'];
-	dirty = dirty or (self:get_historylength() ~= (historylength and true or nil))
+	local historylength = tonumber(fields['muc#roomconfig_historylength']);
+	dirty = dirty or (historylength and (self:get_historylength() ~= historylength));
 	module:log('debug', 'historylength=%s', historylength)
 
 
-- 
cgit v1.2.3