core/offlinemessage.lua
author matthew@silver
Sun, 24 Aug 2008 18:01:20 +0100
changeset 5 57e4eb3aeac0
child 129 0f119bece309
permissions -rw-r--r--
Added all the files to please hg :/
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     1
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     2
require "util.datamanager"
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     3
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     4
local datamanager = datamanager;
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     5
local t_insert = table.insert;
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     6
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     7
module "offlinemessage"
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     8
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
     9
function new(user, host, stanza)
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
    10
	local offlinedata = datamanager.load(user, host, "offlinemsg") or {};
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
    11
	t_insert(offlinedata, stanza);
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
    12
	return datamanager.store(user, host, "offlinemsg", offlinedata);
57e4eb3aeac0 Added all the files to please hg :/
matthew@silver
parents:
diff changeset
    13
end