File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -574,21 +574,22 @@ purge() {
574574 | send_stanza_iq set
575575}
576576
577- # subscribe <node> < jid>
577+ # subscribe <node> [ jid]
578578subscribe () {
579579 local node=$1
580- local jid=$( qualify_jid $2 )
580+ local jid=$( qualify_jid ${2- $xmpp_user } )
581581
582582 # check args
583- if (( $# < 2 )) || [[ " $1 " =~ --help ]] || [[ " $1 " =~ -h ]]; then
584- echo " Usage: subscribe <node> < jid> "
583+ if (( $# < 1 )) || [[ " $1 " =~ --help ]] || [[ " $1 " =~ -h ]]; then
584+ echo " Usage: subscribe <node> [ jid] "
585585 echo " Subscribe \" jid\" to the pubsub \" node\" "
586586 return 0
587587 fi
588588
589- echo " <subscribe node='$node ' jid='$jid '/>" \
590- | stanza_pubsub \
591- | send_stanza_iq set
589+ eof \
590+ | stanza subscribe " node=$node " " jid=$jid " \
591+ | stanza_pubsub \
592+ | send_stanza_iq set
592593}
593594
594595# unsubscribe <node> <jid>
You can’t perform that action at this time.
0 commit comments