ejabberd - Unable to get xmpp muc room information in android -
I am using the asmack library for my chat application. Meg Room information: Using the code described after successful login:
MultiUser Chat Multi User Chat = New Multius Chat (Connection, "VJNEMO Seandroid @ Confir.chat"); MMultiUserChat.join (USERNAME); Try {if (mMultiUserChat.isJoined () == true) {RoomInfo roomInfo = mMultiUserChat.getRoomInfo (connection, "VjNewMoiosandroid@conference.chat");}} hold (exception e) {// TODO: handle exception e.printStackTrace ( ); }
I get this error while getting room information, while I debug and check that I am getting room information in the log but nothing Do not come in the room.
10-10 08: 55: 12.388: W / System.err (1821): java.lang.ClassCastException: org.jivesoftware.smack.util.PacketParserUtils $ 2 org.jivesoftware.smackx .packet.DiscoverInfo can not be molded 10-10 08: 55: 12.428: W / System.err (1821): 55: 12.458: org.jivesoftware.smackx.ServiceDiscoveryManager.discoverInfo (ServiceDiscoveryManager.java:600) 10-10 08 / w / System.err (1821): 55: 12.478: W / System.err (1821): com.demo.xmppchat.CopyOfXMPPChatDemoActivity.getRoomInfo (CopyOfXMPPChatDemoActivity org.jivesoftware.smackx.ServiceDiscoveryManager.discoverInfo (ServiceDiscoveryManager.java: 552) .java: 469) on 10-10 08
The information in my chat room that I got into logging
10-10 15: 38 : 10.133: D / SMK (26035): 03:38:10 PM RCV (1107887640): & lt; Iq from = 'VJNewMoiosandroid@conference.chat' = '143936715563010 @ 70000 @ Chat / Skak' ID = 'VWA-6' type = 'results' & gt; & Lt; Query xmlns = 'http: //jabber.org/protocol/disco#info'> & Lt; Identity category = 'conference' type = 'text' name = 'VJNEMO.sodo' / & gt; & Lt; Feature var = 'http://jabber.org/protocol/muc'/><feature var =' muc_public '/ & gt; & Lt; Feature var = 'muc_persistent' / & gt; & Lt; Feature var = 'muc_open' / & gt; & Lt; Feature var = 'muc_semianonymous' / & gt; & Lt; Feature var = 'muc_moderated' / & gt; & Lt; Feature var = 'muc_unsecured' /> & Lt; X xmlns = 'jabber: x: data' type = 'result' & gt; & Lt; Field type = 'hidden' var = 'FORM_TYPE' & gt; & Lt; Value & gt; Http://jabber.org/protocol/muc#roominfo</value></field><field labels = 'Room description' var = 'MUC # roominfo_description' & gt; & Lt; Value & gt; & Lt; / Value and gt; & Lt; / Region & gt; & Lt; Area label = var 'number of occupants' = 'MUC # roominfo_occupants' & gt; & Lt; Price & gt; 1 & lt; / Value & gt; & Lt; / Region & gt; & Lt; / X & gt; & Lt; / Query & gt; & Lt; / IQ & gt;
I have a problem that was using the old asmack jar, The MultiUserChat class getRoomInfo () method directly in my class
MultiUserChat mMultiUserChat = new MultiUserChat (connection, "VjNewMoiosandroid@conference.chat"); MMultiUserChat.join (USERNAME); Try {if (mMultiUserChat.isJoined () == true) {string roomInfo = getRoomInfo (connection, "VjNewMoiosandroid@conference.chat");}} hold (exception E) {// TODO: handle exception e.printStackTrace (); }
I have created a method below
public static string getRoomInfo (connection connection , String room) XMPPException {string roomInfo = ""; {ServiceDiscoveryManager serviceDiscoveryManager = Try New Service Discovery Manager (Connection); DiscoverInfo = ServiceDiscoveryManager DiscoverInfo (room); RoomInfo = info.toXML (); } Hold (XMPPException E) {// TODO: Exception Log.e ("xmpp", e.toString ()); } Return Room INFO; }
Comments
Post a Comment