Sun, 20 May 2018 01:57:58 +0200
riddim.plugins.pubsub2room: Return early from extractor if no stanza given
18
d7cd7ce93132
Rudimentary presence plugin to auto-accept subscription requests
Chris <jugg@hotmail.com>
parents:
diff
changeset
|
1 | |
19
a698d64fc929
Rename plugins.presence to plugins.autosubscribe
Matthew Wild <mwild1@gmail.com>
parents:
18
diff
changeset
|
2 | function riddim.plugins.autosubscribe(bot) |
18
d7cd7ce93132
Rudimentary presence plugin to auto-accept subscription requests
Chris <jugg@hotmail.com>
parents:
diff
changeset
|
3 | bot:hook("presence", function (presence) |
d7cd7ce93132
Rudimentary presence plugin to auto-accept subscription requests
Chris <jugg@hotmail.com>
parents:
diff
changeset
|
4 | if presence.stanza.attr.type ~= 'subscribe' then return nil; end |
d7cd7ce93132
Rudimentary presence plugin to auto-accept subscription requests
Chris <jugg@hotmail.com>
parents:
diff
changeset
|
5 | bot:send_presence(presence.sender.jid, 'subscribed'); |
d7cd7ce93132
Rudimentary presence plugin to auto-accept subscription requests
Chris <jugg@hotmail.com>
parents:
diff
changeset
|
6 | return false; |
d7cd7ce93132
Rudimentary presence plugin to auto-accept subscription requests
Chris <jugg@hotmail.com>
parents:
diff
changeset
|
7 | end); |
d7cd7ce93132
Rudimentary presence plugin to auto-accept subscription requests
Chris <jugg@hotmail.com>
parents:
diff
changeset
|
8 | end |