当前位置: 首页>>代码示例>>Java>>正文


Java MultiUserChat.addInvitationListener方法代码示例

本文整理汇总了Java中org.jivesoftware.smackx.muc.MultiUserChat.addInvitationListener方法的典型用法代码示例。如果您正苦于以下问题:Java MultiUserChat.addInvitationListener方法的具体用法?Java MultiUserChat.addInvitationListener怎么用?Java MultiUserChat.addInvitationListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.smackx.muc.MultiUserChat的用法示例。


在下文中一共展示了MultiUserChat.addInvitationListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
	setContentView(R.layout.muc_room);
	con = XmppConnectionManager.getInstance().getConnection();
	muc = XmppConnectionManager.getInstance().getMuc();
	muc.addInvitationRejectionListener(this);
	MultiUserChat.addInvitationListener(con, this);
	muc.addParticipantStatusListener(this);
	muc.addMessageListener(this);
	app = EimApplication.getInstance();
	membersList = (ListView) findViewById(R.id.members);
	chatsList = (ListView) findViewById(R.id.chats);
	content = (EditText) findViewById(R.id.content);
	membersList.setOnItemClickListener(this);
	initData();
	
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:20,代码来源:MUCRoom.java

示例2: onCreate

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.contacter_main);
    init();
    MultiUserChat.addInvitationListener(XmppConnectionManager.getInstance().getConnection(), ContacterMainActivity.this);
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:9,代码来源:ContacterMainActivity.java

示例3: onCreate

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
	setContentView(R.layout.room_chat);
	room_name=(TextView)findViewById(R.id.to_room_name);
	con = XmppConnectionManager.getInstance().getConnection();
	muc = XmppConnectionManager.getInstance().getMuc();
	muc.addInvitationRejectionListener(this);
	MultiUserChat.addInvitationListener(con, this);
	muc.addParticipantStatusListener(this);
    muc.addMessageListener(this);
    muc.addMessageListener(new PacketListener() {
		@Override
		public void processPacket(Packet packet) {
			// TODO Auto-generated method stub
			message = (Message) packet;
			android.os.Message ms = new android.os.Message();
			ms.what = 1;
			//handler.handleMessage(ms);
		}
	});
	app = EimApplication.getInstance();
	room_name.setText(muc.getRoom().toString());
	initView();
	init();
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:28,代码来源:RoomChatActivity.java

示例4: Workgroup

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
/**
 * Creates a new workgroup instance using the specified workgroup JID
 * (eg [email protected]) and XMPP connection. The connection must have
 * undergone a successful login before being used to construct an instance of
 * this class.
 *
 * @param workgroupJID the JID of the workgroup.
 * @param connection   an XMPP connection which must have already undergone a
 *                     successful login.
 */
public Workgroup(String workgroupJID, Connection connection) {
    // Login must have been done before passing in connection.
    if (!connection.isAuthenticated()) {
        throw new IllegalStateException("Must login to server before creating workgroup.");
    }

    this.workgroupJID = workgroupJID;
    this.connection = connection;
    inQueue = false;
    invitationListeners = new ArrayList();
    queueListeners = new ArrayList();
    siteInviteListeners = new ArrayList();

    // Register as a queue listener for internal usage by this instance.
    addQueueListener(new QueueListener() {
        public void joinedQueue() {
            inQueue = true;
        }

        public void departedQueue() {
            inQueue = false;
            queuePosition = -1;
            queueRemainingTime = -1;
        }

        public void queuePositionUpdated(int currentPosition) {
            queuePosition = currentPosition;
        }

        public void queueWaitTimeUpdated(int secondsRemaining) {
            queueRemainingTime = secondsRemaining;
        }
    });

    /**
     * Internal handling of an invitation.Recieving an invitation removes the user from the queue.
     */
    MultiUserChat.addInvitationListener(connection,
            new org.jivesoftware.smackx.muc.InvitationListener() {
                public void invitationReceived(Connection conn, String room, String inviter,
                                               String reason, String password, Message message) {
                    inQueue = false;
                    queuePosition = -1;
                    queueRemainingTime = -1;
                }
            });

    // Register a packet listener for all the messages sent to this client.
    PacketFilter typeFilter = new PacketTypeFilter(Message.class);

    connection.addPacketListener(new PacketListener() {
        public void processPacket(Packet packet) {
            handlePacket(packet);
        }
    }, typeFilter);
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:67,代码来源:Workgroup.java

示例5: Workgroup

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
/**
 * Creates a new workgroup instance using the specified workgroup JID
 * (eg [email protected]) and XMPP connection. The connection must have
 * undergone a successful login before being used to construct an instance of
 * this class.
 *
 * @param workgroupJID the JID of the workgroup.
 * @param connection   an XMPP connection which must have already undergone a
 *                     successful login.
 */
public Workgroup(String workgroupJID, Connection connection) {
    // Login must have been done before passing in connection.
    if (!connection.isAuthenticated()) {
        throw new IllegalStateException("Must login to server before creating workgroup.");
    }

    this.workgroupJID = workgroupJID;
    this.connection = connection;
    inQueue = false;
    invitationListeners = new ArrayList<WorkgroupInvitationListener>();
    queueListeners = new ArrayList<QueueListener>();

    // Register as a queue listener for internal usage by this instance.
    addQueueListener(new QueueListener() {
        public void joinedQueue() {
            inQueue = true;
        }

        public void departedQueue() {
            inQueue = false;
            queuePosition = -1;
            queueRemainingTime = -1;
        }

        public void queuePositionUpdated(int currentPosition) {
            queuePosition = currentPosition;
        }

        public void queueWaitTimeUpdated(int secondsRemaining) {
            queueRemainingTime = secondsRemaining;
        }
    });

    /**
     * Internal handling of an invitation.Recieving an invitation removes the user from the queue.
     */
    MultiUserChat.addInvitationListener(connection,
            new org.jivesoftware.smackx.muc.InvitationListener() {
                public void invitationReceived(Connection conn, String room, String inviter,
                                               String reason, String password, Message message) {
                    inQueue = false;
                    queuePosition = -1;
                    queueRemainingTime = -1;
                }
            });

    // Register a packet listener for all the messages sent to this client.
    PacketFilter typeFilter = new PacketTypeFilter(Message.class);

    connection.addPacketListener(new PacketListener() {
        public void processPacket(Packet packet) {
            handlePacket(packet);
        }
    }, typeFilter);
}
 
开发者ID:CJC-ivotten,项目名称:androidPN-client.,代码行数:66,代码来源:Workgroup.java

示例6: Workgroup

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
/**
 * Creates a new workgroup instance using the specified workgroup JID (eg
 * [email protected]) and XMPP connection. The connection must
 * have undergone a successful login before being used to construct an
 * instance of this class.
 * 
 * @param workgroupJID
 *            the JID of the workgroup.
 * @param connection
 *            an XMPP connection which must have already undergone a
 *            successful login.
 */
public Workgroup(String workgroupJID, Connection connection) {
	// Login must have been done before passing in connection.
	if (!connection.isAuthenticated()) {
		throw new IllegalStateException(
				"Must login to server before creating workgroup.");
	}

	this.workgroupJID = workgroupJID;
	this.connection = connection;
	inQueue = false;
	invitationListeners = new ArrayList();
	queueListeners = new ArrayList();
	siteInviteListeners = new ArrayList();

	// Register as a queue listener for internal usage by this instance.
	addQueueListener(new QueueListener() {
		public void joinedQueue() {
			inQueue = true;
		}

		public void departedQueue() {
			inQueue = false;
			queuePosition = -1;
			queueRemainingTime = -1;
		}

		public void queuePositionUpdated(int currentPosition) {
			queuePosition = currentPosition;
		}

		public void queueWaitTimeUpdated(int secondsRemaining) {
			queueRemainingTime = secondsRemaining;
		}
	});

	/**
	 * Internal handling of an invitation.Recieving an invitation removes
	 * the user from the queue.
	 */
	MultiUserChat.addInvitationListener(connection,
			new org.jivesoftware.smackx.muc.InvitationListener() {
				public void invitationReceived(Connection conn,
						String room, String inviter, String reason,
						String password, Message message) {
					inQueue = false;
					queuePosition = -1;
					queueRemainingTime = -1;
				}
			});

	// Register a packet listener for all the messages sent to this client.
	PacketFilter typeFilter = new PacketTypeFilter(Message.class);

	connection.addPacketListener(new PacketListener() {
		public void processPacket(Packet packet) {
			handlePacket(packet);
		}
	}, typeFilter);
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:72,代码来源:Workgroup.java

示例7: addInvitationListener

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
/**
    * Adds an invitation listener to check for any MUC invites.
    */
   private void addInvitationListener() {
MultiUserChat.addInvitationListener(SparkManager.getConnection(),this);
   }
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:7,代码来源:ConferenceServices.java


注:本文中的org.jivesoftware.smackx.muc.MultiUserChat.addInvitationListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。