Quantcast
Channel: Ignite Realtime: Message List
Viewing all articles
Browse latest Browse all 11412

About MultiUserChat.isServiceEnabled(con, con.getUser())

$
0
0

public List<MucRoom> getJoinedRooms() {

 

 

                    List<MucRoom> rooms = new ArrayList<MucRoom>();

                    //判断用户是否支持Multi-User聊天协议   

        //注:需要加上资源标识符   

        boolean supports = MultiUserChat.isServiceEnabled(con, con.getUser());   

        System.out.println("判断用户是否支持Multi-User聊天协议---"+supports);

         //获取某用户所加入的聊天室   

        if(supports) {

                  Iterator<String> jrs = MultiUserChat.getJoinedRooms(con, con.getUser());

                  System.out.println("--->"+con.getUser());

//                        Iterator<String> jrs = MultiUserChat.getJoinedRooms(con, "xjp");    

   

                        while(jrs.hasNext()){

   

                                  System.out.println("@@@@@@@@test3 has joined Room " + jrs.next());

                                  String name  = jrs.next();

                                  System.out.println("name="+name);

                                  MucRoom mr = new MucRoom();

                                  mr.setName(name);

                                  rooms.add(mr);

                        }

        }

 

                    return rooms;

          }

 

        boolean supports = MultiUserChat.isServiceEnabled(con, con.getUser()); 

 

 

I want to get list of MucRoom but supports is always false 。how to do this it.  My asmack is asmack-android-17-0.8.1.1.jar


Viewing all articles
Browse latest Browse all 11412

Trending Articles