public class OperationSetAdHocMultiUserChatIcqImpl extends java.lang.Object implements OperationSetAdHocMultiUserChat
Modifier and Type | Field and Description |
---|---|
protected OperationSetPersistentPresenceIcqImpl |
opSetPersPresence
A reference to the persistent presence operation set that we use to match
incoming messages to Contacts and vice versa.
|
Constructor and Description |
---|
OperationSetAdHocMultiUserChatIcqImpl(ProtocolProviderServiceIcqImpl icqProvider)
Instantiates the user operation set with a currently valid instance of
the Icq protocol provider.
|
Modifier and Type | Method and Description |
---|---|
void |
addInvitationListener(AdHocChatRoomInvitationListener listener)
Adds a listener to invitation notifications.
|
void |
addInvitationRejectionListener(AdHocChatRoomInvitationRejectionListener listener)
Subscribes listener so that it would receive events indicating
rejection of a multi user chat invitation that we've sent earlier.
|
void |
addPresenceListener(LocalUserAdHocChatRoomPresenceListener listener)
Adds a listener that will be notified of changes in our status in a chat
room such as us being kicked, banned or dropped.
|
AdHocChatRoom |
createAdHocChatRoom(java.lang.String adHocRoomName,
java.util.List<java.lang.String> contacts,
java.lang.String reason)
Creates an ad-hoc room with the named adHocRoomName and inviting
the specified list of contacts.
|
AdHocChatRoom |
createAdHocChatRoom(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.
|
void |
fireInvitationEvent(AdHocChatRoom targetChatRoom,
java.lang.String inviter,
java.lang.String reason,
byte[] password)
Delivers a AdHocChatRoomInvitationReceivedEvent to all
registered AdHocChatRoomInvitationListeners.
|
void |
fireLocalUserPresenceEvent(AdHocChatRoom chatRoom,
java.lang.String eventType,
java.lang.String reason)
Delivers a LocalUserAdHocChatRoomPresenceChangeEvent to all
registered LocalUserAdHocChatRoomPresenceListeners.
|
java.util.List<AdHocChatRoom> |
getAdHocChatRooms()
Returns a list of all currently joined AdHocChatRoom-s.
|
void |
rejectInvitation(AdHocChatRoomInvitation invitation,
java.lang.String rejectReason)
Informs the sender of an invitation that we decline their invitation.
|
void |
removeInvitationListener(AdHocChatRoomInvitationListener listener)
Removes listener from the list of invitation listeners
registered to receive invitation events.
|
void |
removeInvitationRejectionListener(AdHocChatRoomInvitationRejectionListener listener)
Removes listener from the list of invitation listeners
registered to receive invitation rejection events.
|
void |
removePresenceListener(LocalUserAdHocChatRoomPresenceListener listener)
Removes a listener that was being notified of changes in our status in a
room such as us being joined or dropped.
|
protected OperationSetPersistentPresenceIcqImpl opSetPersPresence
OperationSetAdHocMultiUserChatIcqImpl(ProtocolProviderServiceIcqImpl icqProvider)
icqProvider
- a currently valid instance of
ProtocolProviderServiceIcqImpl.public void addInvitationListener(AdHocChatRoomInvitationListener listener)
addInvitationListener
in interface OperationSetAdHocMultiUserChat
listener
- an invitation listener.public void addInvitationRejectionListener(AdHocChatRoomInvitationRejectionListener listener)
addInvitationRejectionListener
in interface OperationSetAdHocMultiUserChat
listener
- the listener that we'll subscribe for invitation
rejection events.public void addPresenceListener(LocalUserAdHocChatRoomPresenceListener listener)
addPresenceListener
in interface OperationSetAdHocMultiUserChat
listener
- the LocalUserAdHocChatRoomPresenceListener.public java.util.List<AdHocChatRoom> getAdHocChatRooms()
getAdHocChatRooms
in interface OperationSetAdHocMultiUserChat
public AdHocChatRoom createAdHocChatRoom(java.lang.String roomName, java.util.Map<java.lang.String,java.lang.Object> roomProperties) throws OperationFailedException, OperationNotSupportedException
createAdHocChatRoom
in interface OperationSetAdHocMultiUserChat
roomName
- the name of the AdHocChatRoom to create.roomProperties
- properties specifying how the room should be
created. Contains list of invitees and the invitation message.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 an ad-hoc
chat room).OperationNotSupportedException
- if ad-hoc chat room creation is
not supported by this serverpublic AdHocChatRoom createAdHocChatRoom(java.lang.String adHocRoomName, java.util.List<java.lang.String> contacts, java.lang.String reason) throws OperationFailedException, OperationNotSupportedException
createAdHocChatRoom
in interface OperationSetAdHocMultiUserChat
adHocRoomName
- the name of the ad-hoc room
(however, it won't/does not have to be used since the only way to create
an ICQ room is having a room name which begins by the "chat" prefix
followed by a random number (this is what is used in the ICQ 7 software).contacts
- the list of contacts IDreason
- the reason to be sent with the invitation for contacts.OperationFailedException
OperationNotSupportedException
public void rejectInvitation(AdHocChatRoomInvitation invitation, java.lang.String rejectReason)
rejectInvitation
in interface OperationSetAdHocMultiUserChat
invitation
- the connection to use for sending the rejection.rejectReason
- the reason to reject the given invitationpublic void removeInvitationListener(AdHocChatRoomInvitationListener listener)
removeInvitationListener
in interface OperationSetAdHocMultiUserChat
listener
- the invitation listener to remove.public void removeInvitationRejectionListener(AdHocChatRoomInvitationRejectionListener listener)
removeInvitationRejectionListener
in interface OperationSetAdHocMultiUserChat
listener
- the invitation listener to remove.public void removePresenceListener(LocalUserAdHocChatRoomPresenceListener listener)
removePresenceListener
in interface OperationSetAdHocMultiUserChat
listener
- the LocalUserAdHocChatRoomPresenceListener.public void fireInvitationEvent(AdHocChatRoom targetChatRoom, java.lang.String inviter, java.lang.String reason, byte[] password)
targetChatRoom
- the ad-hoc 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 fireLocalUserPresenceEvent(AdHocChatRoom chatRoom, java.lang.String eventType, java.lang.String reason)
chatRoom
- the AdHocChatRoom which has been joined, left,
etc.eventType
- the type of this event; one of LOCAL_USER_JOINED,
LOCAL_USER_LEFT, etc.reason
- the reason
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.