#!/usr/bin/env lua
+-- Prosody IM v0.2
+-- Copyright (C) 2008 Matthew Wild
+-- Copyright (C) 2008 Waqas Hussain
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+--
+
+
\r
require "erlparse";\r
-require "serialize";\r
\r
package.path = package.path ..";../?.lua";\r
+local serialize = require "util.serialization".serialize;
local st = require "util.stanza";\r
package.loaded["util.logger"] = {init = function() return function() end; end}\r
local dm = require "util.datamanager"\r
elseif tuple[1] == "xmlcdata" then\r
stanza:text(tuple[2]);\r
else\r
- error("unknown element type: "..serialize.serialize(tuple));\r
+ error("unknown element type: "..serialize(tuple));\r
end\r
end\r
function build_time(tuple)\r
end;\r
roster = function(tuple)\r
local node = tuple[3][1]; local host = tuple[3][2];\r
- local contact = tuple[4][1].."@"..tuple[4][2];\r
+ local contact = (type(tuple[4][1]) == "table") and tuple[4][2] or tuple[4][1].."@"..tuple[4][2];\r
local name = tuple[5]; local subscription = tuple[6];\r
local ask = tuple[7]; local groups = tuple[8];\r
if type(name) ~= type("") then name = nil; end\r
count = count + 1;\r
local name = item[1];\r
t[name] = (t[name] or 0) + 1;\r
- --print(count, serialize.serialize(item));\r
+ --print(count, serialize(item));\r
if filters[name] then filters[name](item); end\r
end\r
---print(serialize.serialize(t));\r
+--print(serialize(t));\r