[ejabberd] pubsub#title not fully implemented

Kevin Crosbie kcrosbie at ravenpack.com
Mon Jun 30 15:57:58 MSD 2008


Hi,

It seems that the pubsub#title field is not yet fully supported for 
configuring a pubsub node.
I can configure the field and get no error, but if I request the node 
configuration form, the title is not present.

I made the following modification to mod_pubsub.erl:

C:\cvsroot\ejabberd\trunk\src\mod_pubsub>svn diff mod_pubsub.erl
Index: mod_pubsub.erl
===================================================================
--- mod_pubsub.erl      (revision 1377)
+++ mod_pubsub.erl      (working copy)
@@ -2438,6 +2438,7 @@
      ?BOOL_CONFIG_FIELD("Notify subscribers when the node is deleted", 
notify_delete),
      ?BOOL_CONFIG_FIELD("Notify subscribers when items are removed from 
the node", notify_retract),
      ?BOOL_CONFIG_FIELD("Persist items to storage", persist_items),
+     ?STRING_CONFIG_FIELD("A friendly name for the node", title),
      ?INTEGER_CONFIG_FIELD("Max # of items to persist", max_items),
      ?BOOL_CONFIG_FIELD("Whether to allow subscriptions", subscribe),
      ?ALIST_CONFIG_FIELD("Specify the access model", access_model,

This causes the field to be sent when requesting the node configuration, 
however, the value is always 0 no matter what I set it to at room 
configuration time.
Is there some other change I'd need to make in order to get this to be 
sent correctly?   Looking through the code, it seems that setting the 
title is supported.

Here are the XMPP messages I've been sending after applying my patch:
;; create node
<iq from="test-user-1 at ejabberd/myresource"
    to="pubsub.ejabberd"
    type="set">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <create node='/home/ejabberd/test-user-1/node101'
            name='this is a test'></create>
    <configure>
      <x type="submit" xmlns="jabber:x:data">
        <field var="pubsub#title"><value>Test title</value></field>
      </x>
    </configure>
  </pubsub>
</iq>

;; Get node configuration
<iq from="test-user-1 at ejabberd/myresource"
    to="pubsub.ejabberd"
    type="get">
  <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
    <configure node='/home/ejabberd/test-user-1/node101'></configure>
  </pubsub>
</iq>

;; Response (appropriate field only):
<field type="boolean" label="A friendly name for the node" 
var="pubsub#title" ><value>0</value></field>



More information about the ejabberd mailing list