# HG changeset patch # User Kim Alvefur # Date 1428446670 -7200 # Node ID ad64e2eacd0ebdaffa19ee1be41ce1bc4572a89a # Parent 3deeb38d79ab22f36e73bb6293e2edc697786e67 rostermanager: Add forward declarations diff -r 3deeb38d79ab -r ad64e2eacd0e core/rostermanager.lua --- a/core/rostermanager.lua Tue Apr 07 23:26:32 2015 +0200 +++ b/core/rostermanager.lua Wed Apr 08 00:44:30 2015 +0200 @@ -24,6 +24,8 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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;