diff options
author | Kim Alvefur <zash@zash.se> | 2015-04-08 00:44:30 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-04-08 00:44:30 +0200 |
commit | 95c212d4a302a4c5043811e052698f396c11db62 (patch) | |
tree | d7a75abe8e038233549c8640f6f6cfe66bc6937c /core | |
parent | 3a9da46af5e48f307b12aa8cda171f7d1690f5b1 (diff) | |
download | prosody-95c212d4a302a4c5043811e052698f396c11db62.tar.gz prosody-95c212d4a302a4c5043811e052698f396c11db62.zip |
rostermanager: Add forward declarations
Diffstat (limited to 'core')
-rw-r--r-- | core/rostermanager.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua index 08a507ab..f196ccf3 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -24,6 +24,8 @@ local st = require "util.stanza"; local _ENV = nil; +local save_roster; -- forward declaration + local function add_to_roster(session, jid, item) if session.roster then local old_item = session.roster[jid]; @@ -121,7 +123,7 @@ local function load_roster(username, host) return roster, err; end -local function save_roster(username, host, roster) +function save_roster(username, host, roster) if not um_user_exists(username, host) then log("debug", "not saving roster for %s@%s: the user doesn't exist", username, host); return nil; @@ -161,6 +163,8 @@ local function process_inbound_subscription_approval(username, host, jid) end end +local is_contact_pending_out -- forward declaration + local function process_inbound_subscription_cancellation(username, host, jid) local roster = load_roster(username, host); local item = roster[jid]; @@ -183,6 +187,8 @@ local function process_inbound_subscription_cancellation(username, host, jid) end end +local is_contact_pending_in -- forward declaration + local function process_inbound_unsubscribe(username, host, jid) local roster = load_roster(username, host); local item = roster[jid]; @@ -223,7 +229,7 @@ local function is_contact_subscribed(username, host, jid) return item and (item.subscription == "from" or item.subscription == "both"), err; end -local function is_contact_pending_in(username, host, jid) +function is_contact_pending_in(username, host, jid) local roster = load_roster(username, host); return roster[false].pending[jid]; end @@ -236,7 +242,7 @@ local function set_contact_pending_in(username, host, jid) roster[false].pending[jid] = true; return save_roster(username, host, roster); end -local function is_contact_pending_out(username, host, jid) +function is_contact_pending_out(username, host, jid) local roster = load_roster(username, host); local item = roster[jid]; return item and item.ask; |