2013-10-30 21:38:23 +01:00
2019-12-26 17:25:11 +01:00
< script type = "text/html" data-template-name = "xmpp in" >
2013-10-30 21:38:23 +01:00
< div class = "form-row" >
2018-09-28 22:42:36 +02:00
< label for = "node-input-server" > < i class = "fa fa-bookmark" > < / i > Connect as< / label >
2014-05-29 19:31:36 +02:00
< input type = "text" id = "node-input-server" >
< / div >
< div class = "form-row" >
2014-09-03 17:12:26 +02:00
< label for = "node-input-to" > < i class = "fa fa-envelope" > < / i > Buddy< / label >
2018-09-29 16:17:18 +02:00
< input type = "text" id = "node-input-to" placeholder = "joe@blah.im" >
2014-05-29 19:31:36 +02:00
< / div >
< div class = "form-row" >
< label > < / label >
2018-09-29 16:17:18 +02:00
< input type = "checkbox" id = "node-input-join" placeholder = "" style = "display:inline-block; width:auto; vertical-align:top;" >
< label for = "node-input-join" style = "width:70%;" > Is a Chat Room ?< / label >
2014-05-29 19:31:36 +02:00
< / div >
< div class = "form-row" >
2014-09-03 17:12:26 +02:00
< label for = "node-input-name" > < i class = "fa fa-tag" > < / i > Name< / label >
2014-05-29 19:31:36 +02:00
< input type = "text" id = "node-input-name" placeholder = "Name" >
< / div >
2021-02-23 10:04:12 +01:00
< div class = "form-tips" > < b > Note:< / b > By setting Buddy to "ALL_ROOMS" and ticking "Is a chat room",
the node will try to listen to all the rooms the user has access to.
< / div >
2014-05-29 19:31:36 +02:00
< / script >
2019-12-26 17:25:11 +01:00
< script type = "text/html" data-help-name = "xmpp in" >
2014-05-29 19:31:36 +02:00
< p > Connects to an XMPP server to receive messages.< / p >
2018-09-29 16:17:18 +02:00
< p > The < b > Buddy< / b > field is the jid of the buddy or room you want to receive messages from. Leave blank to receive from anyone.< / p >
< p > Incoming messages will appear as < code > msg.payload< / code > on the first output, while < code > msg.topic< / code > will contain who it is from.
If part of a chat room then < code > msg.room< / code > may also be set.< / p >
< p > The second output will show the presence and status of a user in < code > msg.payload< / code > . Again < code > msg.topic< / code > will hold the users jid.< / p >
2014-05-29 19:31:36 +02:00
< / script >
< script type = "text/javascript" >
RED.nodes.registerType('xmpp in',{
category: 'social-input',
color:"#F4F492",
defaults: {
name: {value:""},
server: {type:"xmpp-server",required:true},
2018-09-28 15:59:22 +02:00
to: {value:""},
2014-05-29 19:31:36 +02:00
join: {value:false}
},
inputs:0,
outputs:2,
icon: "xmpp.png",
label: function() {
return this.name||"xmpp";
},
labelStyle: function() {
return (this.name)?"node_label_italic":"";
}
});
< / script >
2018-09-29 16:17:18 +02:00
2019-12-26 17:25:11 +01:00
< script type = "text/html" data-template-name = "xmpp out" >
2014-05-29 19:31:36 +02:00
< div class = "form-row" >
2018-09-28 22:42:36 +02:00
< label for = "node-input-server" > < i class = "fa fa-bookmark" > < / i > Connect as< / label >
2014-05-29 19:31:36 +02:00
< input type = "text" id = "node-input-server" >
2013-10-30 21:38:23 +01:00
< / div >
< div class = "form-row" >
< label > < / label >
2018-09-29 16:17:18 +02:00
< input type = "checkbox" id = "node-input-sendObject" placeholder = "" style = "display:inline-block; width:auto; vertical-align:top;" >
< label for = "node-input-sendObject" style = "width:70%;" > Send complete msg object ?< / label >
2013-10-30 21:38:23 +01:00
< / div >
< div class = "form-row" >
2014-09-03 17:12:26 +02:00
< label for = "node-input-to" > < i class = "fa fa-envelope" > < / i > To< / label >
2018-09-29 16:17:18 +02:00
< input type = "text" id = "node-input-to" placeholder = "joe@blah.im" >
2013-10-30 21:38:23 +01:00
< / div >
< div class = "form-row" >
< label > < / label >
< input type = "checkbox" id = "node-input-join" placeholder = "" style = "display: inline-block; width: auto; vertical-align: top;" >
2018-09-29 16:17:18 +02:00
< label for = "node-input-join" style = "width:70%;" > Is a Chat Room ?< / label >
2013-10-30 21:38:23 +01:00
< / div >
< div class = "form-row" >
2014-09-03 17:12:26 +02:00
< label for = "node-input-name" > < i class = "fa fa-tag" > < / i > Name< / label >
2013-10-30 21:38:23 +01:00
< input type = "text" id = "node-input-name" placeholder = "Name" >
< / div >
2016-03-02 14:26:53 +01:00
< div class = "form-tips" > The < b > To< / b > field is optional. If not set uses the < code > msg.topic< / code > property of the message.< / div >
2013-10-30 21:38:23 +01:00
< / script >
2019-12-26 17:25:11 +01:00
< script type = "text/html" data-help-name = "xmpp out" >
2014-05-29 19:31:36 +02:00
< p > Connects to an XMPP server to send messages.< / p >
2016-02-12 15:05:10 +01:00
< p > The < b > To< / b > field is optional. If not set the < code > msg.topic< / code > property of the message is used.< / p >
< p > You may also send a msg with < code > msg.presence< / code > to set your presence to one of < i > chat, away, dnd< / i > or < i > xa< / i > .
If you do so then the < code > msg.payload< / code > will set your status message.< / p >
2013-10-30 21:38:23 +01:00
< / script >
< script type = "text/javascript" >
2014-05-29 19:31:36 +02:00
RED.nodes.registerType('xmpp out',{
category: 'social-output',
color:"#F4F492",
2013-10-30 21:38:23 +01:00
defaults: {
name: {value:""},
2014-05-29 19:31:36 +02:00
server: {type:"xmpp-server",required:true},
2013-10-30 21:38:23 +01:00
to: {value:""},
join: {value:false},
2014-05-29 19:31:36 +02:00
sendObject: {value:false}
2013-10-30 21:38:23 +01:00
},
inputs:1,
2014-05-29 19:31:36 +02:00
outputs:0,
2013-10-30 21:38:23 +01:00
icon: "xmpp.png",
2014-05-29 19:31:36 +02:00
align: "right",
2013-10-30 21:38:23 +01:00
label: function() {
2014-05-29 19:31:36 +02:00
return this.name||"xmpp";
2013-10-30 21:38:23 +01:00
},
labelStyle: function() {
2014-05-29 19:31:36 +02:00
return (this.name)?"node_label_italic":"";
}
});
< / script >
2019-12-26 17:25:11 +01:00
< script type = "text/html" data-template-name = "xmpp-server" >
2020-10-24 16:02:45 +02:00
< div class = "form-row" >
2014-09-03 17:12:26 +02:00
< label for = "node-config-input-server" > < i class = "fa fa-bookmark" > < / i > Server< / label >
2019-12-26 17:25:11 +01:00
< input class = "input-append-left" type = "text" id = "node-config-input-server" placeholder = "blah.im" style = "width: 40%;" >
2014-05-29 19:31:36 +02:00
< label for = "node-config-input-port" style = "margin-left: 10px; width: 35px; " > Port< / label >
< input type = "text" id = "node-config-input-port" placeholder = "Port" style = "width:45px" >
2019-12-26 17:25:11 +01:00
< / div >
2018-09-28 15:59:22 +02:00
< div class = "form-row" >
< label for = "node-config-input-user" > < i class = "fa fa-user" > < / i > JID< / label >
2018-09-29 16:17:18 +02:00
< input type = "text" id = "node-config-input-user" placeholder = "joe@blah.im" >
2014-05-29 19:31:36 +02:00
< / div >
< div class = "form-row" >
2014-09-03 17:12:26 +02:00
< label for = "node-config-input-nickname" > < i class = "fa fa-user" > < / i > Nickname< / label >
2018-09-29 16:17:18 +02:00
< input type = "text" id = "node-config-input-nickname" placeholder = "Joe (optional)" >
2014-05-29 19:31:36 +02:00
< / div >
< div class = "form-row" >
2014-09-03 17:12:26 +02:00
< label for = "node-config-input-pass" > < i class = "fa fa-lock" > < / i > Password< / label >
2015-02-06 22:10:14 +01:00
< input type = "password" id = "node-config-input-password" >
2014-05-29 19:31:36 +02:00
< / div >
< / script >
< script type = "text/javascript" >
RED.nodes.registerType('xmpp-server',{
category: 'config',
defaults: {
2020-07-16 11:00:27 +02:00
server: {required:false},
port: {value:5222,required:false,validate:RED.validators.number()},
2018-09-28 15:59:22 +02:00
user: {type:"text"},
2018-09-29 16:17:18 +02:00
nickname: {value:""}
2014-05-29 19:31:36 +02:00
},
2015-02-06 22:10:14 +01:00
credentials: {
2018-09-29 16:17:18 +02:00
password: {type:"password"}
2015-02-06 22:10:14 +01:00
},
2014-05-29 19:31:36 +02:00
label: function() {
2018-09-28 15:59:22 +02:00
return this.user;
2013-10-30 21:38:23 +01:00
}
});
< / script >
2018-09-29 16:17:18 +02:00
2019-12-26 17:25:11 +01:00
< script type = "text/html" data-help-name = "xmpp-server" >
2018-09-29 16:17:18 +02:00
< p > The connection to an XMPP server to send and receive messages.< / p >
< p > Connects to the standard C2S port 5222 on the server.< / p >
< p > The JID is the full username of the client used to connect to the server
and must contain the resolvable fdqn of the server.< / p >
< p > The nickname is optional.< / p >
< / script >