Project

General

Profile

Send message to all user

Vinoth Rajendran
Added about 4 years ago

I am using Tigase 5.2.3. I want to send message to all registered users in tigase.

Is there any option available?


Replies (4)

Added by Wojciech Kapcia TigaseTeam about 4 years ago

Currently it's not possible. It should be fairly easy to modify existing @/src/main/groovy/tigase/admin/BroadcastToOnline.groovy@ to send messages to all users instead of only online users (you would need to retrieve list of users from repository).

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 4 years ago

At least PubSub is not a component to do this. PubSub is a component which sends messages (notifications) to all subscribers. So if you want to use PubSub you would need a PubSub node to which all your registered users are subscribed. I guess, this should be not that difficult to do, to subscribe all your users to a pubsub node.

Otherwise, another approach would be not to use PubSub but admin ad-hoc commands instead as described by Wojciech.

(1)

Added by Vinoth Rajendran about 4 years ago

When I sent following stanza to Tigase to send notification to all online users.

<iq from='54c24dc0a1bd2a7a09bddb72@192.168.1.94/vinoth'
    id='announce-2'
    to='192.168.1.94'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           node='http://jabber.org/protocol/admin#announce'
           sessionid='announce:20040408T0337Z'>
    <x xmlns='jabber:x:data' type='submit'>
      <field type='hidden' var='FORM_TYPE'>
        <value>http://jabber.org/protocol/admin</value>
      </field>
      <field var='announcement'>
        <value>Attention! This service will be going down for</value>
        <value>maintenance in 2 minutes. Please log off now!</value>
        <value>We apologize for the inconvenience.</value>
      </field>
    </x>
  </command>
</iq>

Tigase replies,

<iq to="54c24dc0a1bd2a7a09bddb72@192.168.1.94/tigase-16" type="error" from="192.168.1.94" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams"><command node="http://jabber.org/protocol/admin#announce" xmlns="http://jabber.org/protocol/commands"><x type="submit" xmlns="jabber:x:data"><field type="hidden" var="FORM_TYPE"><value>http://jabber.org/protocol/admin<field var="announcement"/><value>Attention! This service will be going down for</value></value></field></x></command><error code="404" type="wait"><recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">The recipient is no longer available.</text></error></iq>

How can do that?

(1)

Added by Wojciech Kapcia TigaseTeam about 4 years ago

Vinoth Rajendran wrote:

When I sent following stanza to Tigase to send notification to all online users.

to='192.168.1.94'

How can do that?

You should address the command to sess-man@<domain> instead of plain @@.

    (1-4/4)