core/offlinemessage.lua

Tue, 18 Nov 2008 17:52:33 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 18 Nov 2008 17:52:33 +0000
changeset 331
830fd67f9378
parent 129
0f119bece309
child 519
cccd610a0ef9
permissions
-rw-r--r--

Quite some changes, to:

- Small logging fix for s2smanager
- Send a stream error if an incoming s2s connection is to an unrecognised hostname (fixes #11)
- init_xmlhandlers now takes a table of callbacks (includes changes to net/xmpp*_listener for this)
- Move sending of unavailable presence to where it should be, sessionmanager.destroy_session
- Fix sending of stream errors to wrong connection


require "util.datamanager"

local datamanager = datamanager;
local t_insert = table.insert;

module "offlinemessage"

function new(user, host, stanza)
	local offlinedata = datamanager.load(user, host, "offlinemsg") or {};
	t_insert(offlinedata, stanza);
	return datamanager.store(user, host, "offlinemsg", offlinedata);
end

return _M;

mercurial