本文整理汇总了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();
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}