2013-08-12 54 views
1

如何在asmack(無需加入房間)中獲得延長房間信息(包括住戶人數,房間主題等)?我使用getRoomInfo()方法,使用迪斯科#信息協議,它發送報文給服務器:在asmack中獲取更多房間信息QuickBlox

<iq from='[email protected]/pda' 
    id='ik3vs715' 
    to='[email protected]' 
    type='get'> 
    <query xmlns='http://jabber.org/protocol/disco#info'/> 
</iq> 

的問題是,我recieving非標準報文,而無需額外的信息:

<iq from='[email protected]' 
    id='ik3vs715' 
    to='[email protected]/pda' 
    type='result'> 
    <query xmlns='http://jabber.org/protocol/disco#info'> 
    <identity 
     category='conference' 
     name='A Dark Cave' 
     type='text'/> 
    <feature var='http://jabber.org/protocol/muc'/> 
    <feature var='muc_passwordprotected'/> 
    <feature var='muc_hidden'/> 
    <feature var='muc_temporary'/> 
    <feature var='muc_open'/> 
    <feature var='muc_unmoderated'/> 
    <feature var='muc_nonanonymous'/> 
    </query> 
</iq> 

我想收到(帶有附加信息的)分組是像例如:

<iq from='[email protected]' 
    id='ik3vs715' 
    to='[email protected]/pda' 
    type='result'> 
    <query xmlns='http://jabber.org/protocol/disco#info'> 
    <identity 
     category='conference' 
     name='A Dark Cave' 
     type='text'/> 
    <feature var='http://jabber.org/protocol/muc'/> 
    <feature var='muc_passwordprotected'/> 
    <feature var='muc_hidden'/> 
    <feature var='muc_temporary'/> 
    <feature var='muc_open'/> 
    <feature var='muc_unmoderated'/> 
    <feature var='muc_nonanonymous'/> 
    <x xmlns='jabber:x:data' type='result'> 
     <field var='FORM_TYPE' type='hidden'> 
     <value>http://jabber.org/protocol/muc#roominfo</value> 
     </field> 
     <field var='muc#roominfo_description' 
      label='Description'> 
     <value>The place for all good witches!</value> 
     </field> 
     <field var='muc#roominfo_changesubject' 
      label='Occupants May Change the Subject'> 
     <value>true</value> 
     </field> 
     <field var='muc#roominfo_contactjid' 
      label='Contact Addresses'> 
     <value>[email protected]</value> 
     </field> 
     <field var='muc#roominfo_subject' 
      label='Current Discussion Topic'> 
     <value>Spells</value> 
     </field> 
     <field var='muc#roomconfig_changesubject' 
      label='Subject can be modified'> 
     <value>true</value> 
     </field> 
     <field var='muc#roominfo_occupants' 
      label='Number of occupants'> 
     <value>3</value> 
     </field> 
     <field var='muc#roominfo_ldapgroup' 
      label='Associated LDAP Group'> 
     <value>cn=witches,dc=shakespeare,dc=lit</value> 
     </field> 
     <field var='muc#roominfo_lang' 
      label='Language of discussion'> 
     <value>en</value> 
     </field> 
     <field var='muc#roominfo_logs' 
      label='URL for discussion logs'> 
     <value>http://www.shakespeare.lit/chatlogs/coven/</value> 
     </field> 
     <field var='muc#maxhistoryfetch' 
      label='Maximum Number of History Messages Returned by Room'> 
     <value>50</value> 
     </field> 
     <field var='muc#roominfo_pubsub' 
      label='Associated pubsub node'> 
     <value>xmpp:pubsub.shakespeare.lit?;node=the-coven-node</value> 
     </field> 
    </x> 
    </query> 
</iq> 

我該怎麼做才能讓我的房間擴展信息?我正在使用QuickBlox API和他們的服務器謝謝

回答

0

不幸的是QuickBlox聊天服務器目前只支持短暫的房間信息。

我建議您使用CustomObjects記錄來包裝聊天室並存儲任何額外的房間信息