Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

custom provider for subscribe authorization

$
0
0

I am trying to create a provider extension for following stanza as this feature is not available in smack yet. its a feature to handle incoming subscription permission.

 

 

 

<message from="pubsub.example.com" to="fdf72c24@example.com" id="89939">

<x xmlns="jabber:x:data" type="form">

           <title>PubSub subscriber request</title>

           <instructions>Use the following form to approve or deny the subscription request.</instructions>

           <field var="FORM_TYPE" type="hidden">

                     <value>http://jabber.org/protocol/pubsub#subscribe_authorization</value>

           </field>

           <field var="pubsub#subid" type="hidden">

                     <value>9QojXw0GKibSGF6eu5xOzurK8m2iFMp9jJcO4llb</value>

           </field>

           <field var="pubsub#node" type="text-single" label="Node ID">

                     <value>fdf72c24/loc</value>

           </field>

           <field var="pubsub#subscriber_jid" type="jid-single" label="Subscriber Address">

                     <value>88f37b90@example.com</value>

           </field>

           <field var="pubsub#allow" type="boolean" label="Allow this JID to subscribe to this pubsub node?">

                     <value>0</value>

           </field>

    </x>

</message>

 

 

 

I have created customPacketExtensionProvider and PacketExtension to handle above xml stanza but the issue is when i add Privoder as follows

 

 

pm.addExtensionProvider(

                              "x",

                              "jabber:x:data",

                              new  com.bcl.provider.SubFormProvider());

 

 

this provider overlaps with the default DataFormProvider

 

            pm.addExtensionProvider(

                              "x",

                              "jabber:x:data",

                              new org.jivesoftware.smackx.provider.DataFormProvider());

 

 

 

so is there a way to differentiate between DataFormProvider and SubFormProvider ( custom provider) so that i can handle above xml stanza like the smack does.


Viewing all articles
Browse latest Browse all 10742

Trending Articles