Changeset

57:830baad98c9a

clix.roster: Show incomming subscription requests when --presence is used
author Kim Alvefur <zash@zash.se>
date Tue, 15 Mar 2011 18:32:51 +0100
parents 56:4b5f9a50ae68
children 58:d5d9f7dffc1f
files clix/roster.lua
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/clix/roster.lua	Tue Mar 15 18:29:24 2011 +0100
+++ b/clix/roster.lua	Tue Mar 15 18:32:51 2011 +0100
@@ -125,6 +125,15 @@
 			conn:hook("roster/item-changed", notif("changed"));
 			conn:hook("roster/item-removed", notif("removed"));
 		end
+		if opts.presence then
+			conn:hook("presence", function(presence)
+				if presence.attr.type == "subscribe" then
+					print(("%s wants to subscribe to you"):format(presence.attr.from));
+				--elseif presence.attr.type == "subscribed" then
+					--print(("%s subscribed to you?"):format(presence.attr.from));
+				end
+			end)
+		end
 	end
 	clix_connect(opts, on_connect);
 end