Package org.jivesoftware.smackx.muc

Examples of org.jivesoftware.smackx.muc.MultiUserChat


    }

    @Override
    protected void doConnect() throws ConnectException
    {
        chat = new MultiUserChat(connection, recipient);
        joinChat();
    }
View Full Code Here


        return packetCollector.nextResult(timeout);
    }

    public void joinGroupchat(String chatroom) throws XMPPException
    {
        groupchat = new MultiUserChat(connection, chatroom);
        groupchat.join(UUID.getUUID().toString());
    }
View Full Code Here

    @Override
    protected void doStart() throws Exception {
        super.doStart();
        if (chat == null) {
            chat = new MultiUserChat(endpoint.getConnection(), room);
            String nickname = this.endpoint.getNickname();
            chat.join(nickname != null ? nickname : this.endpoint.getUser());
        }
    }
View Full Code Here

            // we must add the listener before creating the muc
            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class), toFilter);
            connection.addPacketListener(this, packetFilter);

            muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
            muc.addMessageListener(this);
            DiscussionHistory history = new DiscussionHistory();
            history.setMaxChars(0); // we do not want any historical messages

            muc.join(endpoint.getNickname(), null, history, SmackConfiguration.getPacketReplyTimeout());
View Full Code Here

            connection = endpoint.createConnection();
        }

        if (chat == null) {
            room = endpoint.resolveRoom(connection);
            chat = new MultiUserChat(connection, room);
            DiscussionHistory history = new DiscussionHistory();
            history.setMaxChars(0); // we do not want any historical messages
            chat.join(endpoint.getNickname(), null, history, SmackConfiguration.getPacketReplyTimeout());
            if (LOG.isInfoEnabled()) {
                LOG.info("Joined room: " + room + " as: " + endpoint.getNickname());
View Full Code Here

  public int joinChatroomByAddr(String roomAddr, String nickname) {
//    if(!checkParam(roomAddr)|| !checkParam(nickname)){
//      Util.showErrMsg("joinChatroomByAddr:参数为空!!");
//      return -1;
//    }
    muc = new MultiUserChat(connection, roomAddr);   
    try {
      muc.join(nickname);
      if (muc.isJoined()) {
        muc.addMessageListener(new AllMUCMsgListener(
            new BufferedWriter(new OutputStreamWriter(System.out)),
View Full Code Here

  static public boolean chatXMPP(
      @ParamDoc(name="message") String message) {
    boolean success = false;
   
    try {
      MultiUserChat chat = XMPPConnect.getChat();

      try {
        while(message.length()>=2000) {
          chat.sendMessage(message.substring(0, 2000));
          message = message.substring(2000);
        }
        chat.sendMessage(message);
        logger.debug("Sent message '{}' to multi user chat.", message);
        success = true;
      } catch (XMPPException e) {
        logger.warn("Error Delivering block", e);
      } catch (NotConnectedException e) {
View Full Code Here

        if (!initialized) {
          throw new NotInitializedException();
        }
      } 
     
      chat = new MultiUserChat(connection, chatroom);
     
      try {
        if (chatpassword != null) {
          chat.join(chatnickname, chatpassword);
        } else {
View Full Code Here

      final String server = ecfConnection.getXMPPConnection().getHost();
      final String domain = (properties == null) ? XMPPRoomID.DOMAIN_DEFAULT : (String) properties.get(PROP_XMPP_CONFERENCE);
      final String conference = XMPPRoomID.fixConferenceDomain(domain, server);
      final String roomID = roomname + XMPPRoomID.AT_SIGN + conference;
      // create proxy to the room
      final MultiUserChat muc = new MultiUserChat(ecfConnection.getXMPPConnection(), roomID);

      if (!checkRoom(conference, roomID)) {
        // otherwise create a new one
        muc.create(nickname);
        muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
        final String subject = (properties == null) ? null : (String) properties.get(PROP_XMPP_SUBJECT);
        if (subject != null)
          muc.changeSubject(subject);
      }

      String longname = muc.getRoom();
      if (longname == null || longname.length() <= 0) {
        longname = roomID;
      }

      final RoomInfo info = MultiUserChat.getRoomInfo(ecfConnection.getXMPPConnection(), roomID);
View Full Code Here

    synchronized (getConnectLock()) {
      try {
        connectionState = CONNECTING;
        remoteServerID = null;
        addSharedObjectToContainer(remote);
        multiuserchat = new MultiUserChat(getXMPPConnection(), roomID.getMucString());
        // Get nickname from join context
        String nick = null;
        try {
          final Callback[] callbacks = new Callback[1];
          callbacks[0] = new NameCallback(Messages.XMPPChatRoomContainer_NAME_CALLBACK_NICK, roomID.getNickname());
View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.muc.MultiUserChat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.