コード例 #1
0
  private void init(ChatGroup group, boolean isNewSession) {

    mIsGroupChat = true;

    mContactId = insertOrUpdateGroupContactInDb(group);
    group.addMemberListener(mListenerAdapter);

    try {
      mChatSessionManager
          .getChatGroupManager()
          .joinChatGroupAsync(group.getAddress(), group.getName());

      mMessageURI = Imps.Messages.getContentUriByThreadId(mContactId);

      mChatURI = ContentUris.withAppendedId(Imps.Chats.CONTENT_URI, mContactId);

      if (isNewSession) insertOrUpdateChat("");

      for (Contact c : group.getMembers()) {
        mContactStatusMap.put(c.getName(), c.getPresence().getStatus());
      }

    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
コード例 #2
0
 public void onGroupCreated(ChatGroup group) {
   if (mGroupName.equalsIgnoreCase(group.getName())) {
     mGroupMgr.removeGroupListener(this);
     group.addMemberListener(this);
     mGroupMgr.inviteUserAsync(group, (Contact) mChatSession.getParticipant());
   }
 }