verse.plugins.pep: Support taking an item id, default to "current"

Sun, 20 May 2018 00:56:24 +0200

author
Kim Alvefur <zash@zash.se>
date
Sun, 20 May 2018 00:56:24 +0200
changeset 415
37674f8ce263
parent 414
2a5eff919f4a
child 416
92ce569b9b73

verse.plugins.pep: Support taking an item id, default to "current"

XEP-0060 recommends using "current" in section 'Singleton Nodes' and
many PEP use cases follow this pattern.

plugins/pep.lua file | annotate | diff | comparison | revisions
--- a/plugins/pep.lua	Sun May 20 00:51:58 2018 +0200
+++ b/plugins/pep.lua	Sun May 20 00:56:24 2018 +0200
@@ -28,7 +28,7 @@
 		end
 	end
 
-	function stream:publish_pep(item, node)
-		return stream.pubsub:service(nil):node(node or item.attr.xmlns):publish(nil, nil, item)
+	function stream:publish_pep(item, node, id)
+		return stream.pubsub:service(nil):node(node or item.attr.xmlns):publish(id or "current", nil, item)
 	end
 end

mercurial