123 if opts.interactive then |
123 if opts.interactive then |
124 conn:hook("roster/item-added", notif("added")); |
124 conn:hook("roster/item-added", notif("added")); |
125 conn:hook("roster/item-changed", notif("changed")); |
125 conn:hook("roster/item-changed", notif("changed")); |
126 conn:hook("roster/item-removed", notif("removed")); |
126 conn:hook("roster/item-removed", notif("removed")); |
127 end |
127 end |
|
128 if opts.presence then |
|
129 conn:hook("presence", function(presence) |
|
130 if presence.attr.type == "subscribe" then |
|
131 print(("%s wants to subscribe to you"):format(presence.attr.from)); |
|
132 --elseif presence.attr.type == "subscribed" then |
|
133 --print(("%s subscribed to you?"):format(presence.attr.from)); |
|
134 end |
|
135 end) |
|
136 end |
128 end |
137 end |
129 clix_connect(opts, on_connect); |
138 clix_connect(opts, on_connect); |
130 end |
139 end |