Changeset

6787:ad64e2eacd0e

rostermanager: Add forward declarations
author Kim Alvefur <zash@zash.se>
date Wed, 08 Apr 2015 00:44:30 +0200
parents 6786:3deeb38d79ab
children 6788:d64c1f3c7e2e
files core/rostermanager.lua
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;