Diff

plugins/vcard_update.lua @ 395:e86144a4eaa1

plugins: Cleanup [luacheck]
author Kim Alvefur <zash@zash.se>
date Thu, 03 Sep 2015 22:41:27 +0200
parent 392:cdea6a28369e
child 490:6b2f31da9610
line wrap: on
line diff
--- a/plugins/vcard_update.lua	Thu Sep 03 21:46:57 2015 +0200
+++ b/plugins/vcard_update.lua	Thu Sep 03 22:41:27 2015 +0200
@@ -1,6 +1,7 @@
 local verse = require "verse";
 
-local xmlns_vcard, xmlns_vcard_update = "vcard-temp", "vcard-temp:x:update";
+-- local xmlns_vcard = "vcard-temp";
+local xmlns_vcard_update = "vcard-temp:x:update";
 
 local sha1 = require("util.hashes").sha1;
 
@@ -24,7 +25,7 @@
 
 	local x_vcard_update;
 
-	function update_vcard_photo(vCard)
+	local function update_vcard_photo(vCard)
 		local data;
 		for i=1,#vCard do
 			if vCard[i].name == "PHOTO" then
@@ -43,10 +44,10 @@
 		end
 	end
 
-	local _set_vcard = stream.set_vcard;
 
 	--[[ TODO Complete this, it's probably broken.
 	-- Maybe better to hook outgoing stanza?
+	local _set_vcard = stream.set_vcard;
 	function stream:set_vcard(vCard, callback)
 		_set_vcard(vCard, function(event, ...)
 			if event.attr.type == "result" then
@@ -63,7 +64,7 @@
 	--]]
 
 	local initial_vcard_fetch_started;
-	stream:hook("ready", function(event)
+	stream:hook("ready", function()
 		if initial_vcard_fetch_started then return; end
 		initial_vcard_fetch_started = true;
 		-- if stream:jid_supports(nil, xmlns_vcard) then TODO this, correctly