Changeset

3237:420ebea00cf3

mod_default_bookmarks: Add support for <password/>.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 18 Aug 2018 17:38:48 +0100
parents 3236:73906187f964
children 3238:786ba175f2e5
files mod_default_bookmarks/README.markdown mod_default_bookmarks/mod_default_bookmarks.lua
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_default_bookmarks/README.markdown	Sat Aug 18 17:36:50 2018 +0100
+++ b/mod_default_bookmarks/README.markdown	Sat Aug 18 17:38:48 2018 +0100
@@ -33,7 +33,8 @@
 
     default_bookmarks = {
         { jid = "room@conference.example.com", name = "The Room" };
-        { jid = "another-room@conference.example.com", name = "The Other Room" };
+        -- Specifying a password is supported:
+        { jid = "secret-room@conference.example.com", name = "A Secret Room", password = "secret" };
         -- You can also use this compact syntax:
         "yetanother@conference.example.com"; -- this will get "yetanother" as name
     };
--- a/mod_default_bookmarks/mod_default_bookmarks.lua	Sat Aug 18 17:36:50 2018 +0100
+++ b/mod_default_bookmarks/mod_default_bookmarks.lua	Sat Aug 18 17:38:48 2018 +0100
@@ -40,6 +40,9 @@
 		if nick then
 			reply:add_child(nick):up();
 		end
+		if bookmark.password then
+			reply:tag("password"):text(bookmark.password):up();
+		end
 		reply:up();
 	end
 	return reply;