public class OperationSetMultiUserChatJabberImpl extends AbstractOperationSetMultiUserChat implements SubscriptionListener
Constructor and Description |
---|
OperationSetMultiUserChatJabberImpl(ProtocolProviderServiceJabberImpl jabberProvider)
Instantiates the user operation set with a currently valid instance of
the Jabber protocol provider.
|
Modifier and Type | Method and Description |
---|---|
void |
addSmackInvitationRejectionListener(org.jivesoftware.smackx.muc.MultiUserChat muc,
ChatRoom chatRoom)
Add SmackInvitationRejectionListener to MultiUserChat instance
which will dispatch all rejection events.
|
void |
contactModified(ContactPropertyChangeEvent evt)
Updates corresponding chat room members when a contact has been modified
in our contact list.
|
ChatRoom |
createChatRoom(java.lang.String roomName,
java.util.Map<java.lang.String,java.lang.Object> roomProperties)
Creates a room with the named roomName and according to the
specified roomProperties on the server that this protocol
provider is currently connected to.
|
ChatRoom |
findRoom(java.lang.String roomName)
Returns a reference to a chatRoom named roomName.
|
void |
fireInvitationEvent(ChatRoom targetChatRoom,
java.lang.String inviter,
java.lang.String reason,
byte[] password)
Delivers a ChatRoomInvitationReceivedEvent to all
registered ChatRoomInvitationListeners.
|
ChatRoomJabberImpl |
getChatRoom(java.lang.String chatRoomName)
Returns a reference to the chat room named chatRoomName or
null if the room hasn't been cached yet.
|
java.util.List<ChatRoom> |
getCurrentlyJoinedChatRooms()
Returns a list of the chat rooms that we have joined and are currently
active in.
|
java.util.List<java.lang.String> |
getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
Returns the list of currently joined chat rooms for
chatRoomMember.
|
java.util.List<java.lang.String> |
getExistingChatRooms()
Returns the List of Strings indicating chat rooms
currently available on the server that this protocol provider is
connected to.
|
boolean |
isMultiChatSupportedByContact(Contact contact)
Returns true if contact supports multi user chat sessions.
|
boolean |
isPrivateMessagingContact(java.lang.String contactAddress)
Checks if the contact address is associated with private messaging
contact or not.
|
void |
rejectInvitation(ChatRoomInvitation invitation,
java.lang.String rejectReason)
Informs the sender of an invitation that we decline their invitation.
|
void |
subscriptionCreated(SubscriptionEvent evt)
Updates corresponding chat room members when a contact has been created
in our contact list.
|
void |
subscriptionFailed(SubscriptionEvent evt)
Not interested in this event for our member update purposes.
|
void |
subscriptionMoved(SubscriptionMovedEvent evt)
Not interested in this event for our member update purposes.
|
void |
subscriptionRemoved(SubscriptionEvent evt)
Updates corresponding chat room members when a contact has been removed
from our contact list.
|
void |
subscriptionResolved(SubscriptionEvent evt)
Not interested in this event for our member update purposes.
|
addInvitationListener, addInvitationRejectionListener, addPresenceListener, fireInvitationReceived, fireInvitationRejectedEvent, fireLocalUserPresenceEvent, fireLocalUserPresenceEvent, removeInvitationListener, removeInvitationRejectionListener, removePresenceListener
OperationSetMultiUserChatJabberImpl(ProtocolProviderServiceJabberImpl jabberProvider)
jabberProvider
- a currently valid instance of
ProtocolProviderServiceJabberImpl.public void addSmackInvitationRejectionListener(org.jivesoftware.smackx.muc.MultiUserChat muc, ChatRoom chatRoom)
muc
- the smack MultiUserChat instance that we're going to wrap our
chat room around.chatRoom
- the associated chat room instancepublic ChatRoom createChatRoom(java.lang.String roomName, java.util.Map<java.lang.String,java.lang.Object> roomProperties) throws OperationFailedException, OperationNotSupportedException
createChatRoom
in interface OperationSetMultiUserChat
roomName
- the name of the ChatRoom to create.roomProperties
- properties specifying how the room should be
created.OperationFailedException
- if the room couldn't be created for
some reason (e.g. room already exists; user already joined to an
existent room or user has no permissions to create a chat room).OperationNotSupportedException
- if chat room creation is not
supported by this serverpublic ChatRoom findRoom(java.lang.String roomName) throws OperationFailedException, OperationNotSupportedException
findRoom
in interface OperationSetMultiUserChat
roomName
- the name of the ChatRoom that we're looking
for.OperationFailedException
- if an error occurs while trying to
discover the room on the server.OperationNotSupportedException
- if the server does not support
multi user chatpublic java.util.List<ChatRoom> getCurrentlyJoinedChatRooms()
getCurrentlyJoinedChatRooms
in interface OperationSetMultiUserChat
public java.util.List<java.lang.String> getExistingChatRooms() throws OperationFailedException, OperationNotSupportedException
getExistingChatRooms
in interface OperationSetMultiUserChat
OperationFailedException
- if we faile retrieving this list from
the server.OperationNotSupportedException
- if the server does not support
multi user chatpublic boolean isMultiChatSupportedByContact(Contact contact)
isMultiChatSupportedByContact
in interface OperationSetMultiUserChat
contact
- reference to the contact whose support for chat rooms
we are currently querying.public boolean isPrivateMessagingContact(java.lang.String contactAddress)
isPrivateMessagingContact
in interface OperationSetMultiUserChat
public void rejectInvitation(ChatRoomInvitation invitation, java.lang.String rejectReason)
rejectInvitation
in interface OperationSetMultiUserChat
invitation
- the connection to use for sending the rejection.rejectReason
- the reason to reject the given invitationpublic ChatRoomJabberImpl getChatRoom(java.lang.String chatRoomName)
chatRoomName
- the name of the room we're looking for.public java.util.List<java.lang.String> getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember) throws OperationFailedException, OperationNotSupportedException
getCurrentlyJoinedChatRooms
in interface OperationSetMultiUserChat
chatRoomMember
- the member we're looking forOperationFailedException
- if the operation failsOperationNotSupportedException
- if the operation is not supportedpublic void fireInvitationEvent(ChatRoom targetChatRoom, java.lang.String inviter, java.lang.String reason, byte[] password)
targetChatRoom
- the room that invitation refers toinviter
- the inviter that sent the invitationreason
- the reason why the inviter sent the invitationpassword
- the password to use when joining the roompublic void contactModified(ContactPropertyChangeEvent evt)
contactModified
in interface SubscriptionListener
evt
- the SubscriptionEvent that notified uspublic void subscriptionCreated(SubscriptionEvent evt)
subscriptionCreated
in interface SubscriptionListener
evt
- the SubscriptionEvent that notified uspublic void subscriptionFailed(SubscriptionEvent evt)
subscriptionFailed
in interface SubscriptionListener
evt
- the SubscriptionEvent that notified uspublic void subscriptionMoved(SubscriptionMovedEvent evt)
subscriptionMoved
in interface SubscriptionListener
evt
- the SubscriptionEvent that notified uspublic void subscriptionRemoved(SubscriptionEvent evt)
subscriptionRemoved
in interface SubscriptionListener
evt
- the SubscriptionEvent that notified uspublic void subscriptionResolved(SubscriptionEvent evt)
subscriptionResolved
in interface SubscriptionListener
evt
- the SubscriptionEvent that notified us
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.