[sip-comm-dev] Chat room related services...


#1

Hello,

Emil, Yana

I've changed some of the services and events, related to the chat rooms, all i've changed isn't already implemented for irc but i want you to take a look and tell me if you are ok with what i've done and maybe add it to sc :).

And if someone else has an idee about changes, additions to do about multi user chat you are welcome on this thread :wink:

Stéphane

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index: src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

···

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java
--- src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22 Feb 2007 12:37:47 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationRejectedEvent
- extends EventObject
-{
- public InvitationRejectedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22 Feb 2007 12:37:18 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -7,6 +7,7 @@
  package net.java.sip.communicator.service.protocol.event;

  import java.util.*;
+import net.java.sip.communicator.service.protocol.*;

  /**
   * <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property of
@@ -14,14 +15,159 @@
   * The event contains references to the source chat room and provider, the name
   * of the property that has just changed as well as its old and new values.
   *
- * @author Emil Ivov
+ * @author Stéphane Remy
   */
  public class ChatRoomPropertyChangeEvent
      extends EventObject
  {
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room topic being changed, that means the subject of this channel
+ * has changed
+ */
+ public static final String TOPIC_CHANGED = "TopicChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode private, that means the channel is now no more
+ * visible in the list of channels
+ */
+ public static final String MODE_PRIVATE = "ModePrivate";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode secret, that means the channel is now no more
+ * visible in the list of channels and no one can make a request on this channel
+ * in order to see if it exists like in irc a whois on a channel if it is in mode
+ * secret don't response.
+ */
+ public static final String MODE_SECRET = "ModeSecret";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode invite only, that means the channel can only
+ * be joined by invited members.
+ */
+ public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode topic protected, that means the channel topic can only
+ * be changed by operators.
+ */
+ public static final String MODE_TOPIC_PROTECTED = "ModeTopicProtected";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode chat room message only, that means the channel can only receive
+ * messages from a user that is on this channel.
+ */
+ public static final String MODE_CHAT_ROOM_MESSAGE_ONLY = "ModeChatRoomMessageOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode moderated, that means only user that have
+ * enough level in this room can send messages.
+ */
+ public static final String MODE_MODERATED = "ModeModerated";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode max user, that means only a max number of
+ * members can join this chat room.
+ */
+ public static final String MODE_MAX_USER = "ModeMaxUser";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode key, that means that all members need
+ * a key to join this channel.
+ */
+ public static final String MODE_KEY = "ModeKey";
+
+ /**
+ * The type of this event. Values can be any of the above fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible content of the event
+ * that have occurred, like if a key is set, or a max user number...
+ */
+ private String content = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String content,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.content = content;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the above
+ * field values.
+ *
+ * @return one of the field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * A reason string indicating the content of this event.
+ *
+ * @return a human readable String containing the content for this event,
+ * or null if no particular content was specified.
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
      {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
      }

  }
Index: src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
--- src/net/java/sip/communicator/service/protocol/event/InvitationListener.java 22 Feb 2007 12:37:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * A listener that is fired anytime an invitation to join a MUC room is received.
- *
- * @author Emil Ivov
- */
-public interface InvitationListener
-{
- /**
- * Called when we receive an invitation to join an existing ChatRoom.
- * <p>
- * @param evt the <tt>InvitationReceivedEvent</tt> that contains the newly
- * received invitation and its source provider.
- */
- public abstract void invitationReceived(InvitationReceivedEvent evt);
-
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23 Apr 2007 18:11:36 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
  package net.java.sip.communicator.service.protocol.event;

  import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
  /**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in the
+ * source room has changed. Changes may include us being granted admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
   *
   * @author Emil Ivov
+ * @author Stéphane Remy
   */
  public class ChatRoomMemberRoleChangeEvent
      extends EventObject
  {
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole previousRole,
+ ChatRoomMemberRole newRole)
      {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
      }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
  }
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22 Feb 2007 12:36:02 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -6,18 +6,109 @@
   */
  package net.java.sip.communicator.service.protocol.event;

+import java.util.EventObject;
+
+import net.java.sip.communicator.service.protocol.*;
+
  /**
   * Dispatched to notify interested parties that a change in our status in the
   * source room has changed. Changes may include us being kicked, banned, or
   * granted admin permissions.
   *
   * @author Emil Ivov
+ * @author Stéphane Remy
   */
  public class ChatRoomLocalUserStatusChangeEvent
+ extends EventObject
  {
- public ChatRoomLocalUserStatusChangeEvent()
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
      {
- super();
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
      }

+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
  }
Index: src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java
--- src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java 22 Feb 2007 12:37:40 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends EventObject
-{
- public InvitationReceivedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 23 Apr 2007 18:11:22 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 16 May 2007 08:35:07 -0000
@@ -29,13 +29,19 @@
       * Indicates that this event was triggered as a result of the source
       * participant being "kicked" out of the chat room.
       */
- public static final String MEMBER_LEFT = "MemberJoined";
+ public static final String MEMBER_LEFT = "MemberLeft";

     /**
      * Indicates that this event was triggered as a result of the source
      * participant leaving the source chat room.
      */
      public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";

      /**
       * The member that the event relates to.
Index: src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java
--- src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java 22 Feb 2007 12:37:54 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * A listener that dispatches events notifying that an invitation which was
- * sent earlier has been rejected by the invitee.
- *
- * @author Emil Ivov
- */
-public interface InvitationRejectionListener {
-
- /**
- * Called when an invitee rejects an invitation previously sent by us.
- *
- * @param evt the instance of the <tt>InvitationRejectedEvent</tt>
- * containing the rejected chat room invitation as well as the source
- * provider where this happened.
- */
- public void invitationRejected(InvitationRejectedEvent evt);
-}
Index: src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java,v
retrieving revision 1.3
diff -u -r1.3 OperationSetMultiUserChatJabberImpl.java
--- src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java 23 Apr 2007 18:12:18 -0000 1.3
+++ src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java 16 May 2007 08:35:07 -0000
@@ -72,7 +72,7 @@
       *
       * @param listener an invitation listener.
       */
- public void addInvitationListener(InvitationListener listener)
+ public void addInvitationListener(ChatRoomInvitationListener listener)
      {
          synchronized(invitationListeners)
          {
@@ -87,7 +87,7 @@
       *
       * @param listener the invitation listener to remove.
       */
- public void removeInvitationListener(InvitationListener listener)
+ public void removeInvitationListener(ChatRoomInvitationListener listener)
      {
          synchronized(invitationListeners)
          {
@@ -103,7 +103,7 @@
       * rejection events.
       */
      public void addInvitationRejectionListener(
- InvitationRejectionListener listener)
+ ChatRoomInvitationRejectionListener listener)
      {
          synchronized(invitationRejectionListeners)
          {
@@ -118,7 +118,7 @@
       *
       * @param listener the invitation listener to remove.
       */
- public void removeInvitationRejectionListener(InvitationRejectionListener
+ public void removeInvitationRejectionListener(ChatRoomInvitationRejectionListener
                                                    listener)
      {
          synchronized(invitationRejectionListeners)
@@ -309,14 +309,14 @@
       * @throws OperationNotSupportedException if the server does not support
       * multi user chat
       */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
          throws OperationFailedException, OperationNotSupportedException
      {
          assertSupportedAndConnected();

          Iterator joinedRoomsIter
              = MultiUserChat.getJoinedRooms( getXmppConnection()
- , contact.getAddress());
+ , chatRoomMember.getContactAddress());

          List joinedRoomsForContact = new LinkedList();

Index: src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java,v
retrieving revision 1.1
diff -u -r1.1 MultiUserChatManager.java
--- src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java 12 Mar 2007 17:38:51 -0000 1.1
+++ src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java 16 May 2007 08:35:07 -0000
@@ -16,8 +16,8 @@
   * @author Yana Stamcheva
   */
  public class MultiUserChatManager
- implements InvitationListener,
- InvitationRejectionListener
+ implements ChatRoomInvitationListener,
+ ChatRoomInvitationRejectionListener
  {
      private MainFrame mainFrame;

@@ -32,12 +32,12 @@
          this.mainFrame = mainFrame;
      }

- public void invitationReceived(InvitationReceivedEvent evt)
+ public void invitationReceived(ChatRoomInvitationReceivedEvent evt)
      {

      }

- public void invitationRejected(InvitationRejectedEvent evt)
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt)
      {

      }
Index: src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
--- src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22 Feb 2007 12:35:34 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 16 May 2007 08:35:07 -0000
@@ -7,13 +7,42 @@
  package net.java.sip.communicator.service.protocol;

  /**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a chat room member
+ * to an other in order to invite this chat room member to join the chat room this invitation
+ * have for target.
+ *
+ * @author Stéphane Remy
   */
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
  {
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no reason
+ *
+ * @return the reason of this invitation, or null if there is no reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
  }
Index: src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
--- src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java 22 Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v
retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
--- src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 23 Apr 2007 18:12:44 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 16 May 2007 08:35:07 -0000
@@ -45,11 +45,11 @@
      public List getCurrentlyJoinedChatRooms();

      /**
- * Returns a list of the chat rooms that <tt>contact</tt> has joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt> has joined and is
       * currently active in.
       *
- * @param contact the contact whose current ChatRooms we will be querying.
- * @return a list of the chat rooms that <tt>contact</tt> has joined and is
+ * @param chatRoomMember the chatRoomMember whose current ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt> has joined and is
       * currently active in.
       *
       * @throws OperationFailedException if an error occurs while trying to
@@ -57,7 +57,7 @@
       * @throws OperationNotSupportedException if the server does not support
       * multi user chat
       */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
          throws OperationFailedException, OperationNotSupportedException;

      /**
@@ -110,7 +110,7 @@
       *
       * @param listener an invitation listener.
       */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener listener);

      /**
       * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
       *
       * @param listener the invitation listener to remove.
       */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener listener);

      /**
       * Adds a listener to invitation notifications. The listener will be fired
@@ -127,7 +127,7 @@
       * @param listener an invitation listener.
       */
      public void addInvitationRejectionListener(
- InvitationRejectionListener listener);
+ ChatRoomInvitationRejectionListener listener);

      /**
       * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,7 +136,7 @@
       * @param listener the invitation listener to remove.
       */
      public void removeInvitationRejectionListener(
- InvitationRejectionListener listener);
+ ChatRoomInvitationRejectionListener listener);

      /**
       * Returns true if <tt>contact</tt> supports multi user chat sessions.
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by us.
+ *
+ * @param evt the instance of the <tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt> representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified <tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source, ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceMessage()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing reception of the
+ * <tt>source</tt> invitation received from the specified <tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source, ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceMessage()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the chat
+ * participants in a particular chat room, such as us being granded any of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of the
+ * source room participant has changed.
+ */
+ public void memberStatusChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

--
Vous êtes unique, comme tout le monde!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hi Stephane,

Sorry for the late response. You have done really good work here. Bravo!

I would propose just some minor changes to discuss:
- In ChatRoomMemberRoleListener we should called the method memberRoleChanged, instead of memberStatusChanged. (I think it's a copy paste error)
- In ChatRoomInvitatioXXXEvent we should rename the method getSourceMessage to getSourceInvitation or getChatRoomInvitation, because actually it returns a ChatRoomInvitation.
- After a discussion with Emil we think that it would be correct that ChatRoomPropertyChangeEvent extends java.beans.PropertyChangeEvent and thus it should implement getOldValue and getNewValue methods.
- We have some doubts for the name TOPIC_CHANGED. In the ChatRoom we already have a property called "subject", so may be it's better to call it SUBJECT_CHANGED here also.
- In fact all the names of properties in the ChatRoomPropertyChangeEvent are not very well matching the convention used for property names. We should change them may be by replacing MODE with PROPERTY and further more by adjusting better the names so that they are more intuitive.
- And finally all properties defined in the ChatRoomPropertyChangeEvent should also exist as properties in the ChatRoom, because they are actually properties of the chat room and we should be able to get and set their value from there.

That's all for now. May be Emil will have something to add.

I should say one more time congratulations for the work :slight_smile:

Yana

StÔŅĹphane Remy wrote:

···

Hello,

Emil, Yana

I've changed some of the services and events, related to the chat rooms, all i've changed isn't already implemented for irc but i want you to take a look and tell me if you are ok with what i've done and maybe add it to sc :).

And if someone else has an idee about changes, additions to do about multi user chat you are welcome on this thread :wink:

StÔŅĹphane

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index: src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

diff -N src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

--- src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22 Feb 2007 12:37:47 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationRejectedEvent
- extends EventObject
-{
- public InvitationRejectedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v

retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22 Feb 2007 12:37:18 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -7,6 +7,7 @@
package net.java.sip.communicator.service.protocol.event;

import java.util.*;
+import net.java.sip.communicator.service.protocol.*;

/**
  * <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property of
@@ -14,14 +15,159 @@
  * The event contains references to the source chat room and provider, the name
  * of the property that has just changed as well as its old and new values.
  *
- * @author Emil Ivov
+ * @author StÔŅĹphane Remy
  */
public class ChatRoomPropertyChangeEvent
     extends EventObject
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room topic being changed, that means the subject of this channel
+ * has changed
+ */
+ public static final String TOPIC_CHANGED = "TopicChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode private, that means the channel is now no more
+ * visible in the list of channels
+ */
+ public static final String MODE_PRIVATE = "ModePrivate";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode secret, that means the channel is now no more
+ * visible in the list of channels and no one can make a request on this channel
+ * in order to see if it exists like in irc a whois on a channel if it is in mode
+ * secret don't response.
+ */
+ public static final String MODE_SECRET = "ModeSecret";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode invite only, that means the channel can only
+ * be joined by invited members.
+ */
+ public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode topic protected, that means the channel topic can only
+ * be changed by operators.
+ */
+ public static final String MODE_TOPIC_PROTECTED = "ModeTopicProtected";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode chat room message only, that means the channel can only receive
+ * messages from a user that is on this channel.
+ */
+ public static final String MODE_CHAT_ROOM_MESSAGE_ONLY = "ModeChatRoomMessageOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode moderated, that means only user that have
+ * enough level in this room can send messages.
+ */
+ public static final String MODE_MODERATED = "ModeModerated";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode max user, that means only a max number of
+ * members can join this chat room.
+ */
+ public static final String MODE_MAX_USER = "ModeMaxUser";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode key, that means that all members need
+ * a key to join this channel.
+ */
+ public static final String MODE_KEY = "ModeKey";
+
+ /**
+ * The type of this event. Values can be any of the above fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible content of the event
+ * that have occurred, like if a key is set, or a max user number...
+ */
+ private String content = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String content,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.content = content;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the above
+ * field values.
+ *
+ * @return one of the field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * A reason string indicating the content of this event.
+ *
+ * @return a human readable String containing the content for this event,
+ * or null if no particular content was specified.
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
     {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
     }

}
Index: src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

diff -N src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

--- src/net/java/sip/communicator/service/protocol/event/InvitationListener.java 22 Feb 2007 12:37:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * A listener that is fired anytime an invitation to join a MUC room is received.
- *
- * @author Emil Ivov
- */
-public interface InvitationListener
-{
- /**
- * Called when we receive an invitation to join an existing ChatRoom.
- * <p>
- * @param evt the <tt>InvitationReceivedEvent</tt> that contains the newly
- * received invitation and its source provider.
- */
- public abstract void invitationReceived(InvitationReceivedEvent evt);
-
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v

retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23 Apr 2007 18:11:36 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in the
+ * source room has changed. Changes may include us being granted admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
  *
  * @author Emil Ivov
+ * @author StÔŅĹphane Remy
  */
public class ChatRoomMemberRoleChangeEvent
     extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole previousRole,
+ ChatRoomMemberRole newRole)
     {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
     }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v

retrieving revision 1.1
diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22 Feb 2007 12:36:02 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -6,18 +6,109 @@
  */
package net.java.sip.communicator.service.protocol.event;

+import java.util.EventObject;
+
+import net.java.sip.communicator.service.protocol.*;
+
/**
  * Dispatched to notify interested parties that a change in our status in the
  * source room has changed. Changes may include us being kicked, banned, or
  * granted admin permissions.
  *
  * @author Emil Ivov
+ * @author StÔŅĹphane Remy
  */
public class ChatRoomLocalUserStatusChangeEvent
+ extends EventObject
{
- public ChatRoomLocalUserStatusChangeEvent()
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
     {
- super();
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
     }

+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
}
Index: src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java

diff -N src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java

--- src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java 22 Feb 2007 12:37:40 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends EventObject
-{
- public InvitationReceivedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java,v

retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 23 Apr 2007 18:11:22 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 16 May 2007 08:35:07 -0000
@@ -29,13 +29,19 @@
      * Indicates that this event was triggered as a result of the source
      * participant being "kicked" out of the chat room.
      */
- public static final String MEMBER_LEFT = "MemberJoined";
+ public static final String MEMBER_LEFT = "MemberLeft";

    /**
     * Indicates that this event was triggered as a result of the source
     * participant leaving the source chat room.
     */
     public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";

     /**
      * The member that the event relates to.
Index: src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java

diff -N src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java

--- src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java 22 Feb 2007 12:37:54 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * A listener that dispatches events notifying that an invitation which was
- * sent earlier has been rejected by the invitee.
- *
- * @author Emil Ivov
- */
-public interface InvitationRejectionListener {
-
- /**
- * Called when an invitee rejects an invitation previously sent by us.
- *
- * @param evt the instance of the <tt>InvitationRejectedEvent</tt>
- * containing the rejected chat room invitation as well as the source
- * provider where this happened.
- */
- public void invitationRejected(InvitationRejectedEvent evt);
-}
Index: src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java

===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java,v

retrieving revision 1.3
diff -u -r1.3 OperationSetMultiUserChatJabberImpl.java
--- src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java 23 Apr 2007 18:12:18 -0000 1.3
+++ src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java 16 May 2007 08:35:07 -0000
@@ -72,7 +72,7 @@
      *
      * @param listener an invitation listener.
      */
- public void addInvitationListener(InvitationListener listener)
+ public void addInvitationListener(ChatRoomInvitationListener listener)
     {
         synchronized(invitationListeners)
         {
@@ -87,7 +87,7 @@
      *
      * @param listener the invitation listener to remove.
      */
- public void removeInvitationListener(InvitationListener listener)
+ public void removeInvitationListener(ChatRoomInvitationListener listener)
     {
         synchronized(invitationListeners)
         {
@@ -103,7 +103,7 @@
      * rejection events.
      */
     public void addInvitationRejectionListener(
- InvitationRejectionListener listener)
+ ChatRoomInvitationRejectionListener listener)
     {
         synchronized(invitationRejectionListeners)
         {
@@ -118,7 +118,7 @@
      *
      * @param listener the invitation listener to remove.
      */
- public void removeInvitationRejectionListener(InvitationRejectionListener
+ public void removeInvitationRejectionListener(ChatRoomInvitationRejectionListener
                                                   listener)
     {
         synchronized(invitationRejectionListeners)
@@ -309,14 +309,14 @@
      * @throws OperationNotSupportedException if the server does not support
      * multi user chat
      */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
         throws OperationFailedException, OperationNotSupportedException
     {
         assertSupportedAndConnected();

         Iterator joinedRoomsIter
             = MultiUserChat.getJoinedRooms( getXmppConnection()
- , contact.getAddress());
+ , chatRoomMember.getContactAddress());

         List joinedRoomsForContact = new LinkedList();

Index: src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java

===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java,v

retrieving revision 1.1
diff -u -r1.1 MultiUserChatManager.java
--- src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java 12 Mar 2007 17:38:51 -0000 1.1
+++ src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java 16 May 2007 08:35:07 -0000
@@ -16,8 +16,8 @@
  * @author Yana Stamcheva
  */
public class MultiUserChatManager
- implements InvitationListener,
- InvitationRejectionListener
+ implements ChatRoomInvitationListener,
+ ChatRoomInvitationRejectionListener
{
     private MainFrame mainFrame;

@@ -32,12 +32,12 @@
         this.mainFrame = mainFrame;
     }

- public void invitationReceived(InvitationReceivedEvent evt)
+ public void invitationReceived(ChatRoomInvitationReceivedEvent evt)
     {

     }

- public void invitationRejected(InvitationRejectedEvent evt)
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt)
     {

     }
Index: src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v

retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
--- src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22 Feb 2007 12:35:34 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 16 May 2007 08:35:07 -0000
@@ -7,13 +7,42 @@
package net.java.sip.communicator.service.protocol;

/**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a chat room member
+ * to an other in order to invite this chat room member to join the chat room this invitation
+ * have for target.
+ *
+ * @author StÔŅĹphane Remy
  */
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
{
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no reason
+ *
+ * @return the reason of this invitation, or null if there is no reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
}
Index: src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
--- src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java 22 Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java

===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v

retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
--- src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 23 Apr 2007 18:12:44 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 16 May 2007 08:35:07 -0000
@@ -45,11 +45,11 @@
     public List getCurrentlyJoinedChatRooms();

     /**
- * Returns a list of the chat rooms that <tt>contact</tt> has joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt> has joined and is
      * currently active in.
      *
- * @param contact the contact whose current ChatRooms we will be querying.
- * @return a list of the chat rooms that <tt>contact</tt> has joined and is
+ * @param chatRoomMember the chatRoomMember whose current ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt> has joined and is
      * currently active in.
      *
      * @throws OperationFailedException if an error occurs while trying to
@@ -57,7 +57,7 @@
      * @throws OperationNotSupportedException if the server does not support
      * multi user chat
      */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
         throws OperationFailedException, OperationNotSupportedException;

     /**
@@ -110,7 +110,7 @@
      *
      * @param listener an invitation listener.
      */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener listener);

     /**
      * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
      *
      * @param listener the invitation listener to remove.
      */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener listener);

     /**
      * Adds a listener to invitation notifications. The listener will be fired
@@ -127,7 +127,7 @@
      * @param listener an invitation listener.
      */
     public void addInvitationRejectionListener(
- InvitationRejectionListener listener);
+ ChatRoomInvitationRejectionListener listener);

     /**
      * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,7 +136,7 @@
      * @param listener the invitation listener to remove.
      */
     public void removeInvitationRejectionListener(
- InvitationRejectionListener listener);
+ ChatRoomInvitationRejectionListener listener);

     /**
      * Returns true if <tt>contact</tt> supports multi user chat sessions.
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by us.
+ *
+ * @param evt the instance of the <tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt> representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified <tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source, ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceMessage()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing reception of the
+ * <tt>source</tt> invitation received from the specified <tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source, ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceMessage()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the chat
+ * participants in a particular chat room, such as us being granded any of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy StÔŅĹphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of the
+ * source room participant has changed.
+ */
+ public void memberStatusChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

--Vous ÔŅĹtes unique, comme tout le monde!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Yana,

I have made a lot of changes again to this services, i hope i didn't forget something, otherwise don't hesitate to tell it to me i will fixe it.

Quoting Yana Stamcheva <yana@sip-communicator.org>:

Hi Stephane,

Sorry for the late response. You have done really good work here. Bravo!

I would propose just some minor changes to discuss:
- In ChatRoomMemberRoleListener we should called the method
memberRoleChanged, instead of memberStatusChanged. (I think it's a copy
paste error)

I have changed that.

- In ChatRoomInvitatioXXXEvent we should rename the method
getSourceMessage to getSourceInvitation or getChatRoomInvitation,
because actually it returns a ChatRoomInvitation.

It's fixed too.

- After a discussion with Emil we think that it would be correct that
ChatRoomPropertyChangeEvent extends java.beans.PropertyChangeEvent and
thus it should implement getOldValue and getNewValue methods.

For this part i have made a lot of changes, i have used the java.beans.PropertyChangeEvent, but i have also created a class name ChatRoomState which contains all the possible states for a chat room.

- We have some doubts for the name TOPIC_CHANGED. In the ChatRoom we
already have a property called "subject", so may be it's better to call
it SUBJECT_CHANGED here also.

It's fixed too.

- In fact all the names of properties in the
ChatRoomPropertyChangeEvent are not very well matching the convention
used for property names. We should change them may be by replacing MODE
with PROPERTY and further more by adjusting better the names so that
they are more intuitive.

I have made them as intuitive as possible this time, but if you find better words to make them more intuitive just tell me.

- And finally all properties defined in the ChatRoomPropertyChangeEvent
should also exist as properties in the ChatRoom, because they are
actually properties of the chat room and we should be able to get and
set their value from there.

I have changed this too.

That's all for now. May be Emil will have something to add.

I should say one more time congratulations for the work :slight_smile:

Yana

Fot the ChatRoomState class i'm not sure if it is the best way to do, so tell me what do you think about it.

Stéphane

here is the patch:

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

···

===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22 Feb 2007 12:36:02 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * Dispatched to notify interested parties that a change in our status in the
- * source room has changed. Changes may include us being kicked, banned, or
- * granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomLocalUserStatusChangeEvent
-{
- public ChatRoomLocalUserStatusChangeEvent()
- {
- super();
- }
-
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java 23 Apr 2007 18:11:29 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in the status of the chat
- * participants in a particular chat room, such as us being kicked, banned, or
- * granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomMemberListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in the status of the
- * source room participant has changed. Changes may include the participant
- * being kicked, banned, or granted admin permissions.
- */
- public void memberStatusChanged( ChatRoomMemberEvent evt );
-
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22 Feb 2007 12:37:18 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 21 May 2007 07:05:35 -0000
@@ -6,22 +6,114 @@
   */
  package net.java.sip.communicator.service.protocol.event;

-import java.util.*;
+import net.java.sip.communicator.service.protocol.ChatRoom;
+import net.java.sip.communicator.service.protocol.ProtocolProviderService;

  /**
   * <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property of
- * the corresponding chat room (e.g. its subject or type) have been modified.
+ * the corresponding chat room (e.g. its subject or state) have been modified.
   * The event contains references to the source chat room and provider, the name
   * of the property that has just changed as well as its old and new values.
   *
- * @author Emil Ivov
+ * @author Stéphane Remy
   */
  public class ChatRoomPropertyChangeEvent
- extends EventObject
+ extends java.beans.PropertyChangeEvent
  {
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room subject being changed.
+ */
+ public static final String PROPERTY_SUBJECT_CHANGED = "SubjectChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room ban list being changed.
+ */
+ public static final String PROPERTY_BAN_LIST_CHANGED = "BanListChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room user limit being changed.
+ */
+ public static final String PROPERTY_USER_LIMIT_CHANGED = "UserLimitChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room state changed.
+ */
+ public static final String PROPERTY_STATE_CHANGED = "StateChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room password being changed.
+ */
+ public static final String PROPERTY_PASSWORD_CHANGED = "PasswordChanged";
+
+ /**
+ * An optional String indicating a possible reason why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom source,
+ String propertyName,
+ Object oldValue,
+ Object newValue,
+ String reason)
+ {
+ super(source, propertyName, oldValue, newValue);
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with this
+ * event.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns a reference to the protocol provider where the event has
+ * originated.
+ * <p>
+ * @return a reference to the ProtocolProviderService instance where this
+ * event originated.
+ */
+ public ProtocolProviderService getProtocolProvider()
+ {
+ return getSourceChatRoom().getParentProvider();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
      {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + this.getPropertyName()
+ + " sourceRoom="
+ + this.getSource().toString()
+ + "oldValue="
+ + this.getOldValue().toString()
+ + "newValue="
+ + this.getNewValue().toString()
+ + "]";
      }

  }
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 23 Apr 2007 18:11:22 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,124 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-import net.java.sip.communicator.service.protocol.*;
-
-/**
- * Dispatched to notify interested parties that a change in the status of the
- * source room participant has changed. Changes may include the participant
- * being kicked, banned, or granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomMemberEvent
- extends EventObject
-{
- /**
- * Indicates that this event was triggered as a result of the source
- * participant joining the source chat room.
- */
- public static final String MEMBER_JOINED = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant being "kicked" out of the chat room.
- */
- public static final String MEMBER_LEFT = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant leaving the source chat room.
- */
- public static final String MEMBER_KICKED = "MemberKicked";
-
- /**
- * The member that the event relates to.
- */
- private ChatRoomMember sourceMember = null;
-
- /**
- * The type of this event. Values can be any of the MEMBER_XXX-ED fields.
- */
- private String eventType = null;
-
- /**
- * An optional String indicating a possible reason as to why the event
- * might have occurred.
- */
- private String reason = null;
-
- public ChatRoomMemberEvent(ChatRoom sourceRoom,
- ChatRoomMember sourceMember,
- String eventType,
- String reason )
- {
- super(sourceRoom);
- this.sourceMember = sourceMember;
- this.eventType = eventType;
- this.reason = reason;
- }
-
- /**
- * Returns the source chat room for this event.
- *
- * @return the <tt>ChatRoom</tt> associated with that is the source of this
- * event and that the corresponding ChatRoomMemberBelongs to.
- */
- public ChatRoom getChatRoom()
- {
- return (ChatRoom)getSource();
- }
-
- /**
- * Returns the member that this event is pertaining to.
- * @return the <tt>ChatRoomMember</tt> that this event is pertaining to.
- */
- public ChatRoomMember getChatRoomMember()
- {
- return sourceMember;
- }
-
- /**
- * A reason string indicating a human readable reason for this event.
- *
- * @return a human readable String containing the reason for this event,
- * or null if no particular reason was specified.
- */
- public String getReason()
- {
- return reason;
- }
-
- /**
- * Returns the type of this event which could be one of the MEMBER_XXX-ed
- * member field values.
- *
- * @return one of the MEMBER_XXXed member field values indicating the type
- * of this event.
- */
- public String getEventType()
- {
- return eventType;
- }
-
- /**
- * Returns a String representation of this event.
- */
- public String toString()
- {
- return "ChatRoomMemberEvent[type="
- + getEventType()
- + " sourceRoom="
- + getChatRoom()
- + " member="
- + getChatRoomMember()
- + "]";
- }
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java 22 Feb 2007 12:36:09 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in our status in the room
- * such as us being kicked, banned, or granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomLocalUserStatusListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in our status in the
- * source soom has changed. Changes may include us being kicked, banned, or
- * granted admin permissions.
- */
- public void localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt);
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23 Apr 2007 18:11:36 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 21 May 2007 07:05:35 -0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
  package net.java.sip.communicator.service.protocol.event;

  import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
  /**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in the
+ * source room has changed. Changes may include us being granted admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
   *
   * @author Emil Ivov
+ * @author Stéphane Remy
   */
  public class ChatRoomMemberRoleChangeEvent
      extends EventObject
  {
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole previousRole,
+ ChatRoomMemberRole newRole)
      {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
      }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
  }
Index: src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
--- src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22 Feb 2007 12:35:34 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 21 May 2007 07:05:34 -0000
@@ -7,13 +7,42 @@
  package net.java.sip.communicator.service.protocol;

  /**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a chat room member
+ * to an other in order to invite this chat room member to join the chat room this invitation
+ * have for target.
+ *
+ * @author Stéphane Remy
   */
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
  {
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no reason
+ *
+ * @return the reason of this invitation, or null if there is no reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
  }
Index: src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
--- src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java 22 Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/ChatRoom.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoom.java,v
retrieving revision 1.4
diff -u -r1.4 ChatRoom.java
--- src/net/java/sip/communicator/service/protocol/ChatRoom.java 24 Apr 2007 12:31:25 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/ChatRoom.java 21 May 2007 07:05:34 -0000
@@ -17,7 +17,6 @@
   */
  public interface ChatRoom
  {
-
      /**
       * Returns the name of this <tt>ChatRoom</tt>.
       *
@@ -95,25 +94,6 @@
      public void leave();

      /**
- * Adds <tt>listener</tt> to the list of listeners registered to receive
- * events upon modification of chat room properties such as its subject
- * for example.
- *
- * @param listener ChatRoomChangeListener
- */
- public void addChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener listener);
-
- /**
- * Removes <tt>listener</tt> from the list of listeneres current registered
- * for chat room modification events.
- *
- * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
- */
- public void removeChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener listener);
-
- /**
       * Returns the last known room subject/theme or <tt>null</tt> if the user
       * hasn't joined the room or the room does not have a subject yet.
       * <p>
@@ -163,41 +143,88 @@
         throws OperationFailedException;

     /**
- * Adds a listener that will be notified of changes in our status in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our participation in the room
+ * such as us being kicked, join, left.
      *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
      */
- public void addLocalUserStatusListener(
- ChatRoomLocalUserStatusListener listener);
+ public void addLocalUserParticipationListener(
+ ChatRoomLocalUserParticipationListener listener);

     /**
- * Removes a listener that was being notified of changes in our status in
- * the room such as us being kicked, banned, or granted admin permissions.
+ * Removes a listener that was being notified of changes in our participation in
+ * the room such as us being kicked, join, left...
      *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
      */
- public void removeLocalUserStatusListener(
- ChatRoomLocalUserStatusListener listener);
+ public void removeLocalUserParticipationListener(
+ ChatRoomLocalUserParticipationListener listener);

     /**
- * Adds a listener that will be notified of changes in our status in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our participation in the room
+ * such as us being kicked, join, left...
      *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
      */
- public void addMemberListener(ChatRoomMemberListener listener);
+ public void addMemberParticipationListener(ChatRoomMemberParticipationListener listener);

     /**
- * Removes a listener that was being notified of changes in the status of
- * other chat room participants such as users being kicked, banned, or
- * granted admin permissions.
+ * Removes a listener that was being notified of changes in the participation of
+ * other chat room participants such as users being kicked, join, left.
      *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
      */
- public void removeMemberListener(
- ChatRoomMemberListener listener);
-
+ public void removeMemberParticipationListener(ChatRoomMemberParticipationListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes in our role in the room
+ * such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in our role in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes of a member role in the room
+ * such as being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void addMemberRoleListener(ChatRoomMemberRoleListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes of a member role in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void removeMemberRoleListener(ChatRoomMemberRoleListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes in the property of the room
+ * such as the subject being change or the room state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void addPropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in the property of
+ * the chat room such as the subject being change or the room state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void removePropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
      /**
       * Invites another user to this room.
       * <p>
@@ -285,6 +312,82 @@
       */
      public ProtocolProviderService getParentProvider();

- //include - roominfo
- /** @todo include room info */
+ /**
+ * Sets the password of this chat room. If the user does not have the right
+ * to change the room password, or the protocol does not support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param password the new password that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setPassword(final String password)
+ throws OperationFailedException;
+
+ /**
+ * Adds a ban mask to the list fo ban masks of this chat room. If the user does
+ * not have the right to change the room ban list, or the protocol does not
+ * support this, or the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the new ban mask that we'd like to add to this room ban list
+ * @throws OperationFailedException
+ */
+ public void addBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Remove a ban mask of the list fo ban masks of this chat room. If the user does
+ * not have the right to change the room ban list, or the protocol does not
+ * support this, or the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the ban mask that we'd like to remove from this room ban list
+ * @throws OperationFailedException
+ */
+ public void removeBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Sets the user limit of this chat room. If the user does not have the right
+ * to change the room user limit, or the protocol does not support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param userLimit the new user limit that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setUserLimit(final int userLimit)
+ throws OperationFailedException;
+
+ /**
+ * Sets a state of this chat room. If the user does not have the right
+ * to change the room state, or the protocol does not support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param state the new state that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setState(ChatRoomState state)
+ throws OperationFailedException;
+
+ /**
+ * Returns the list of ban mask that are currently of this chat room.
+ * @return List the ban list of this room.
+ */
+ public List getBanList();
+
+ /**
+ * Returns the list of states that this chat room is currently in.
+ * @return List the list of states of this chat room.
+ */
+ public List getStateList();
+
+ /**
+ * Returns the limit of user of this chat room, of returns -1 if there is
+ * no limit.
+ * @return List the list of states of this chat room.
+ */
+ public int getUserLimit();
  }
Index: src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v
retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
--- src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 23 Apr 2007 18:12:44 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 21 May 2007 07:05:35 -0000
@@ -45,11 +45,11 @@
      public List getCurrentlyJoinedChatRooms();

      /**
- * Returns a list of the chat rooms that <tt>contact</tt> has joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt> has joined and is
       * currently active in.
       *
- * @param contact the contact whose current ChatRooms we will be querying.
- * @return a list of the chat rooms that <tt>contact</tt> has joined and is
+ * @param chatRoomMember the chatRoomMember whose current ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt> has joined and is
       * currently active in.
       *
       * @throws OperationFailedException if an error occurs while trying to
@@ -57,7 +57,7 @@
       * @throws OperationNotSupportedException if the server does not support
       * multi user chat
       */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
          throws OperationFailedException, OperationNotSupportedException;

      /**
@@ -110,7 +110,7 @@
       *
       * @param listener an invitation listener.
       */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener listener);

      /**
       * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
       *
       * @param listener the invitation listener to remove.
       */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener listener);

      /**
       * Adds a listener to invitation notifications. The listener will be fired
@@ -127,7 +127,7 @@
       * @param listener an invitation listener.
       */
      public void addInvitationRejectionListener(
- InvitationRejectionListener listener);
+ ChatRoomInvitationRejectionListener listener);

      /**
       * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,14 +136,5 @@
       * @param listener the invitation listener to remove.
       */
      public void removeInvitationRejectionListener(
- InvitationRejectionListener listener);
-
- /**
- * Returns true if <tt>contact</tt> supports multi user chat sessions.
- *
- * @param contact reference to the contact whose support for chat rooms
- * we are currently querying.
- * @return a boolean indicating whether <tt>contact</tt> supports chatrooms.
- */
- public boolean isMultiChatSupportedByContact(Contact contact);
+ ChatRoomInvitationRejectionListener listener);
  }
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,25 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in our participation in the room
+ * such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomLocalUserParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in our participation in the
+ * source soom has occured. Changes may include us being kicked, join, left.
+ */
+ public void localUserParticipationChanged(ChatRoomLocalUserParticipationChangeEvent evt);
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,28 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the chat
+ * participants in a particular chat room, such as us being granded any of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomLocalUserRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of the
+ * source room participant has changed.
+ */
+ public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent evt);
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,112 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.EventObject;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our paticipation in the
+ * source room has occured. Changes may include us being kicked, join, left...
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserParticipationChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,131 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in the participation of the
+ * source room participant has changed. Changes may include the participant
+ * being kicked, join, left...
+ *
+ * @author Emil Ivov
+ */
+public class ChatRoomMemberParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomMemberParticipationChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ String eventType,
+ String reason )
+ {
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining to.
+ */
+ public ChatRoomMember getChatRoomMember()
+ {
+ return sourceMember;
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomMemberEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom().toString()
+ + " member="
+ + getChatRoomMember().toString()
+ + "]";
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by us.
+ *
+ * @param evt the instance of the <tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the participation of the chat
+ * member in a particular chat room, such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomMemberParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the participation of the
+ * source room member has changed. Changes may include the participant
+ * being kicked, join, left.
+ */
+ public void memberParticipationChanged(ChatRoomMemberParticipationChangeEvent evt );
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt> representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified <tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source, ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,77 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our role in the
+ * source room has changed. Changes may include us being granted admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserRoleChangeEvent
+ extends EventObject
+{
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMemberRole previousRole,
+ ChatRoomMemberRole newRole)
+ {
+ super(sourceRoom);
+ this.previousRole = previousRole;
+ this.newRole = newRole;
+ }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing reception of the
+ * <tt>source</tt> invitation received from the specified <tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source, ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/ChatRoomState.java

RCS file: src/net/java/sip/communicator/service/protocol/ChatRoomState.java
diff -N src/net/java/sip/communicator/service/protocol/ChatRoomState.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/ChatRoomState.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,589 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+/**
+ * The ChatRoomState class reflects the current state of a chat room.
+ *
+ * @author Stéphane Remy
+ */
+public class ChatRoomState
+{
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_VISIBLE state.
+ * <p>
+ * This constant has the String value "Visible".
+ */
+ public static final String _CHATROOM_VISIBLE = "Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_VISIBLE = new ChatRoomState(_CHATROOM_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Not Visible".
+ */
+ public static final String _CHATROOM_NOT_VISIBLE = "Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_VISIBLE = new ChatRoomState(_CHATROOM_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Required".
+ */
+ public static final String _CHATROOM_PASSWORD_REQUIRED = "Password Required";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_REQUIRED = new ChatRoomState(_CHATROOM_PASSWORD_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Not Required".
+ */
+ public static final String _CHATROOM_PASSWORD_NOT_REQUIRED = "Password Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_NOT_REQUIRED = new ChatRoomState(_CHATROOM_PASSWORD_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Required".
+ */
+ public static final String _CHATROOM_INVITATION_REQUIRED = "Invitation Required";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUIRED = new ChatRoomState(_CHATROOM_INVITATION_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Not Required".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_REQUIRED = "Invitation Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_REQUIRED = new ChatRoomState(_CHATROOM_INVITATION_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_LIMITED = "User Number Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_LIMITED = new ChatRoomState(_CHATROOM_USER_NUMBER_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Not Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_NOT_LIMITED = "User Number Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_NOT_LIMITED = new ChatRoomState(_CHATROOM_USER_NUMBER_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MUTE state.
+ * <p>
+ * This constant has the String value "Mute".
+ */
+ public static final String _CHATROOM_MUTE = "Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * mute state no messages are get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_MUTE = new ChatRoomState(_CHATROOM_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_MUTE state.
+ * <p>
+ * This constant has the String value "Not Mute".
+ */
+ public static final String _CHATROOM_NOT_MUTE = "Not Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * mute state messages can be get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_NOT_MUTE = new ChatRoomState(_CHATROOM_NOT_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_ALLOWED = "External Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in an
+ * external messages allowed state, this chat room can receive messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_EXTERNAL_MESSAGES_ALLOWED = new ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Not Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED = "External Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in an
+ * external messages allowed state, this chat room can not receive messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED = new ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_REGISTERED state.
+ * <p>
+ * This constant has the String value "Registered".
+ */
+ public static final String _CHATROOM_REGISTERED = "Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_REGISTERED = new ChatRoomState(_CHATROOM_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Not Registered".
+ */
+ public static final String _CHATROOM_NOT_REGISTERED = "Not Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_REGISTERED = new ChatRoomState(_CHATROOM_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Locked".
+ */
+ public static final String _CHATROOM_SUBJECT_LOCKED = "Subject Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * subject locked state, only admin users can change the subject of this chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_LOCKED = new ChatRoomState(_CHATROOM_SUBJECT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Not locked".
+ */
+ public static final String _CHATROOM_SUBJECT_NOT_LOCKED = "Subject Not locked";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * subject locked state, all users can change the subject of this chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_NOT_LOCKED = new ChatRoomState(_CHATROOM_SUBJECT_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_ALLOWED = "Message Format Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * message format allowed, all colored, underlined... messages are allowed.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_ALLOWED = new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Not Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED = "Message Format Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * message format not allowed, all colored, underlined... messages are not allowed.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED = new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_FILTERED = "Message Format Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * message format filtered state, all colored, underlined... messages are seen in standard format
+ * by other users.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_FILTERED = new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Not Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_FILTERED = "Message Format Not Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * message format filtered state, all colored, underlined... messages are seen
+ * by other users.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_NOT_FILTERED = new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_LIMITED = "Join Time Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * join time limited state, users can only join in an interval of X time.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_LIMITED = new ChatRoomState(_CHATROOM_JOIN_TIME_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Not Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_NOT_LIMITED = "Join Time Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * join time limited state.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_NOT_LIMITED = new ChatRoomState(_CHATROOM_JOIN_TIME_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_REQUEST_ALLOWED = "Invitation Request Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in an
+ * invitation request allowed state, all invitation request are allowed.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUEST_ALLOWED = new ChatRoomState(_CHATROOM_INVITATION_REQUEST_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Not Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_REQUEST_NOT_ALLOWED = "Invitation Request Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in an
+ * invitation request allowed state, all invitation request are rejected.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUEST_NOT_ALLOWED = new ChatRoomState(_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Redirected".
+ */
+ public static final String _CHATROOM_USER_REDIRECTED = "User Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in an
+ * user redirected state, all users which join this chat room are redirected to an other one.
+ */
+ public static final ChatRoomState CHATROOM_USER_REDIRECTED = new ChatRoomState(_CHATROOM_USER_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NOT_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Not Redirected".
+ */
+ public static final String _CHATROOM_USER_NOT_REDIRECTED = "User Not Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in an
+ * user redirected state, all users which join this chat room are not redirected.
+ */
+ public static final ChatRoomState CHATROOM_USER_NOT_REDIRECTED = new ChatRoomState(_CHATROOM_USER_NOT_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_LOCKED = "Nicknames Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * nicknames locked state, users in this chat room can not change their nickname.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_LOCKED = new ChatRoomState(_CHATROOM_NICKNAMES_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Not Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_NOT_LOCKED = "Nicknames Not Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * nicknames locked state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_NOT_LOCKED = new ChatRoomState(_CHATROOM_NICKNAMES_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Locked".
+ */
+ public static final String _CHATROOM_KICK_LOCKED = "Kick Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * kick locked state, kicks are locked on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_KICK_LOCKED = new ChatRoomState(_CHATROOM_KICK_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Not Locked".
+ */
+ public static final String _CHATROOM_KICK_NOT_LOCKED = "Kick Not Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * kick locked state.
+ */
+ public static final ChatRoomState CHATROOM_KICK_NOT_LOCKED = new ChatRoomState(_CHATROOM_KICK_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Registered".
+ */
+ public static final String _CHATROOM_USERS_REGISTERED = "Users Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * users registered state, only registered users can join this room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_REGISTERED = new ChatRoomState(_CHATROOM_USERS_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Not Registered".
+ */
+ public static final String _CHATROOM_USERS_NOT_REGISTERED = "Users Not Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * users registered state, all users can join this chat room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_NOT_REGISTERED = new ChatRoomState(_CHATROOM_USERS_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_ALLOWED = "Special Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * special messages allowed state.
+ */
+ public static final ChatRoomState CHATROOM_SPECIAL_MESSAGES_ALLOWED = new ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Not Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED = "Special Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * special messages allowed state, only a specific level type of message are allowed.
+ */
+ public static final ChatRoomState CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED = new ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_VISIBLE = "Nickname List Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAME_LIST_VISIBLE = new ChatRoomState(_CHATROOM_NICKNAME_LIST_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Not Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_NOT_VISIBLE = "Nickname List Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAME_LIST_NOT_VISIBLE = new ChatRoomState(_CHATROOM_NICKNAME_LIST_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_ALLOWED = "Invitation Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently in a
+ * invitation allowed state, users can invite other users in this chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_ALLOWED = new ChatRoomState(_CHATROOM_INVITATION_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Not Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_ALLOWED = "Invitation Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is currently not in a
+ * invitation allowed state, users can not invite other users in this chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_ALLOWED = new ChatRoomState(_CHATROOM_INVITATION_NOT_ALLOWED);
+
+ /**
+ * A string representation of this Chat Room State.
+ */
+ private String chatRoomStateStr;
+
+ /**
+ * Create a chat room state object with a value corresponding to the specified
+ * string.
+ * @param chatRoomState a string representation of the state.
+ */
+ private ChatRoomState(String chatRoomState)
+ {
+ this.chatRoomStateStr = chatRoomState;
+ }
+
+ /**
+ * Returns a String representation of that chat room State.
+ *
+ * @return a string value (one of the _CHATROOM_XXX constants) representing
+ * this chat room state).
+ */
+ public String getStateString()
+ {
+ return chatRoomStateStr;
+ }
+
+ /**
+ * Returns a string represenation of this call state. Strings returned
+ * by this method have the following format:
+ * "ChatRoomState:<STATE_STRING>" and are meant to be used for loggin/debugging
+ * purposes.
+ * @return a string representation of this object.
+ */
+ public String toString()
+ {
+ return getClass().getName()+":"+getStateString();
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java
diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the chat
+ * participants in a particular chat room, such as us being granded any of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of the
+ * source room participant has changed.
+ */
+ public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

Stéphane Remy wrote:

Hello,

Emil, Yana

I've changed some of the services and events, related to the chat rooms, all i've changed isn't already implemented for irc but i want you to take a look and tell me if you are ok with what i've done and maybe add it to sc :).

And if someone else has an idee about changes, additions to do about multi user chat you are welcome on this thread :wink:

Stéphane

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index: src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java diff -N src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java --- src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22 Feb 2007 12:37:47 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationRejectedEvent
- extends EventObject
-{
- public InvitationRejectedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java ===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22 Feb 2007 12:37:18 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -7,6 +7,7 @@
package net.java.sip.communicator.service.protocol.event;

import java.util.*;
+import net.java.sip.communicator.service.protocol.*;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property of
@@ -14,14 +15,159 @@
* The event contains references to the source chat room and provider, the name
* of the property that has just changed as well as its old and new values.
*
- * @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomPropertyChangeEvent
    extends EventObject
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room topic being changed, that means the subject of this channel
+ * has changed
+ */
+ public static final String TOPIC_CHANGED = "TopicChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode private, that means the channel is now no more
+ * visible in the list of channels
+ */
+ public static final String MODE_PRIVATE = "ModePrivate";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode secret, that means the channel is now no more
+ * visible in the list of channels and no one can make a request on this channel
+ * in order to see if it exists like in irc a whois on a channel if it is in mode
+ * secret don't response.
+ */
+ public static final String MODE_SECRET = "ModeSecret";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode invite only, that means the channel can only
+ * be joined by invited members.
+ */
+ public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode topic protected, that means the channel topic can only
+ * be changed by operators.
+ */
+ public static final String MODE_TOPIC_PROTECTED = "ModeTopicProtected";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode chat room message only, that means the channel can only receive
+ * messages from a user that is on this channel.
+ */
+ public static final String MODE_CHAT_ROOM_MESSAGE_ONLY = "ModeChatRoomMessageOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode moderated, that means only user that have
+ * enough level in this room can send messages.
+ */
+ public static final String MODE_MODERATED = "ModeModerated";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode max user, that means only a max number of
+ * members can join this chat room.
+ */
+ public static final String MODE_MAX_USER = "ModeMaxUser";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room being set in mode key, that means that all members need
+ * a key to join this channel.
+ */
+ public static final String MODE_KEY = "ModeKey";
+
+ /**
+ * The type of this event. Values can be any of the above fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible content of the event
+ * that have occurred, like if a key is set, or a max user number...
+ */
+ private String content = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String content,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.content = content;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the above
+ * field values.
+ *
+ * @return one of the field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * A reason string indicating the content of this event.
+ *
+ * @return a human readable String containing the content for this event,
+ * or null if no particular content was specified.
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
    {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
    }

}
Index: src/net/java/sip/communicator/service/protocol/event/InvitationListener.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationListener.java diff -N src/net/java/sip/communicator/service/protocol/event/InvitationListener.java --- src/net/java/sip/communicator/service/protocol/event/InvitationListener.java 22 Feb 2007 12:37:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * A listener that is fired anytime an invitation to join a MUC room is received.
- *
- * @author Emil Ivov
- */
-public interface InvitationListener
-{
- /**
- * Called when we receive an invitation to join an existing ChatRoom.
- * <p>
- * @param evt the <tt>InvitationReceivedEvent</tt> that contains the newly
- * received invitation and its source provider.
- */
- public abstract void invitationReceived(InvitationReceivedEvent evt);
-
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java ===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23 Apr 2007 18:11:36 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in the
+ * source room has changed. Changes may include us being granted admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
    extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole previousRole,
+ ChatRoomMemberRole newRole)
    {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
    }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java ===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22 Feb 2007 12:36:02 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16 May 2007 08:35:07 -0000
@@ -6,18 +6,109 @@
*/
package net.java.sip.communicator.service.protocol.event;

+import java.util.EventObject;
+
+import net.java.sip.communicator.service.protocol.*;
+
/**
* Dispatched to notify interested parties that a change in our status in the
* source room has changed. Changes may include us being kicked, banned, or
* granted admin permissions.
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomLocalUserStatusChangeEvent
+ extends EventObject
{
- public ChatRoomLocalUserStatusChangeEvent()
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
    {
- super();
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
    }

+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
}
Index: src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java diff -N src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java --- src/net/java/sip/communicator/service/protocol/event/InvitationReceivedEvent.java 22 Feb 2007 12:37:40 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends EventObject
-{
- public InvitationReceivedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java ===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberEvent.java
--- src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 23 Apr 2007 18:11:22 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 16 May 2007 08:35:07 -0000
@@ -29,13 +29,19 @@
     * Indicates that this event was triggered as a result of the source
     * participant being "kicked" out of the chat room.
     */
- public static final String MEMBER_LEFT = "MemberJoined";
+ public static final String MEMBER_LEFT = "MemberLeft";

   /**
    * Indicates that this event was triggered as a result of the source
    * participant leaving the source chat room.
    */
    public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";

    /**
     * The member that the event relates to.
Index: src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java diff -N src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java --- src/net/java/sip/communicator/service/protocol/event/InvitationRejectionListener.java 22 Feb 2007 12:37:54 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * A listener that dispatches events notifying that an invitation which was
- * sent earlier has been rejected by the invitee.
- *
- * @author Emil Ivov
- */
-public interface InvitationRejectionListener {
-
- /**
- * Called when an invitee rejects an invitation previously sent by us.
- *
- * @param evt the instance of the <tt>InvitationRejectedEvent</tt>
- * containing the rejected chat room invitation as well as the source
- * provider where this happened.
- */
- public void invitationRejected(InvitationRejectedEvent evt);
-}
Index: src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java ===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java,v retrieving revision 1.3
diff -u -r1.3 OperationSetMultiUserChatJabberImpl.java
--- src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java 23 Apr 2007 18:12:18 -0000 1.3
+++ src/net/java/sip/communicator/impl/protocol/jabber/OperationSetMultiUserChatJabberImpl.java 16 May 2007 08:35:07 -0000
@@ -72,7 +72,7 @@
     *
     * @param listener an invitation listener.
     */
- public void addInvitationListener(InvitationListener listener)
+ public void addInvitationListener(ChatRoomInvitationListener listener)
    {
        synchronized(invitationListeners)
        {
@@ -87,7 +87,7 @@
     *
     * @param listener the invitation listener to remove.
     */
- public void removeInvitationListener(InvitationListener listener)
+ public void removeInvitationListener(ChatRoomInvitationListener listener)
    {
        synchronized(invitationListeners)
        {
@@ -103,7 +103,7 @@
     * rejection events.
     */
    public void addInvitationRejectionListener(
- InvitationRejectionListener listener)
+ ChatRoomInvitationRejectionListener listener)
    {
        synchronized(invitationRejectionListeners)
        {
@@ -118,7 +118,7 @@
     *
     * @param listener the invitation listener to remove.
     */
- public void removeInvitationRejectionListener(InvitationRejectionListener
+ public void removeInvitationRejectionListener(ChatRoomInvitationRejectionListener
                                                  listener)
    {
        synchronized(invitationRejectionListeners)
@@ -309,14 +309,14 @@
     * @throws OperationNotSupportedException if the server does not support
     * multi user chat
     */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
        throws OperationFailedException, OperationNotSupportedException
    {
        assertSupportedAndConnected();

        Iterator joinedRoomsIter
            = MultiUserChat.getJoinedRooms( getXmppConnection()
- , contact.getAddress());
+ , chatRoomMember.getContactAddress());

        List joinedRoomsForContact = new LinkedList();

Index: src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java ===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java,v retrieving revision 1.1
diff -u -r1.1 MultiUserChatManager.java
--- src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java 12 Mar 2007 17:38:51 -0000 1.1
+++ src/net/java/sip/communicator/impl/gui/main/chat/conference/MultiUserChatManager.java 16 May 2007 08:35:07 -0000
@@ -16,8 +16,8 @@
* @author Yana Stamcheva
*/
public class MultiUserChatManager
- implements InvitationListener,
- InvitationRejectionListener
+ implements ChatRoomInvitationListener,
+ ChatRoomInvitationRejectionListener
{
    private MainFrame mainFrame;

@@ -32,12 +32,12 @@
        this.mainFrame = mainFrame;
    }

- public void invitationReceived(InvitationReceivedEvent evt)
+ public void invitationReceived(ChatRoomInvitationReceivedEvent evt)
    {

    }

- public void invitationRejected(InvitationRejectedEvent evt)
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt)
    {

    }
Index: src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
--- src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22 Feb 2007 12:35:34 -0000 1.1
+++ src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 16 May 2007 08:35:07 -0000
@@ -7,13 +7,42 @@
package net.java.sip.communicator.service.protocol;

/**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a chat room member
+ * to an other in order to invite this chat room member to join the chat room this invitation
+ * have for target.
+ *
+ * @author Stéphane Remy
*/
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
{
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no reason
+ *
+ * @return the reason of this invitation, or null if there is no reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
}
Index: src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

RCS file: src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
diff -N src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
--- src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java 22 Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java ===================================================================
RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
--- src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 23 Apr 2007 18:12:44 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 16 May 2007 08:35:07 -0000
@@ -45,11 +45,11 @@
    public List getCurrentlyJoinedChatRooms();

    /**
- * Returns a list of the chat rooms that <tt>contact</tt> has joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt> has joined and is
     * currently active in.
     *
- * @param contact the contact whose current ChatRooms we will be querying.
- * @return a list of the chat rooms that <tt>contact</tt> has joined and is
+ * @param chatRoomMember the chatRoomMember whose current ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt> has joined and is
     * currently active in.
     *
     * @throws OperationFailedException if an error occurs while trying to
@@ -57,7 +57,7 @@
     * @throws OperationNotSupportedException if the server does not support
     * multi user chat
     */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
        throws OperationFailedException, OperationNotSupportedException;

    /**
@@ -110,7 +110,7 @@
     *
     * @param listener an invitation listener.
     */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener listener);

    /**
     * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
     *
     * @param listener the invitation listener to remove.
     */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener listener);

    /**
     * Adds a listener to invitation notifications. The listener will be fired
@@ -127,7 +127,7 @@
     * @param listener an invitation listener.
     */
    public void addInvitationRejectionListener(
- InvitationRejectionListener listener);
+ ChatRoomInvitationRejectionListener listener);

    /**
     * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,7 +136,7 @@
     * @param listener the invitation listener to remove.
     */
    public void removeInvitationRejectionListener(
- InvitationRejectionListener listener);
+ ChatRoomInvitationRejectionListener listener);

    /**
     * Returns true if <tt>contact</tt> supports multi user chat sessions.
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by us.
+ *
+ * @param evt the instance of the <tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt> representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified <tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source, ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceMessage()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing reception of the
+ * <tt>source</tt> invitation received from the specified <tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source, ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceMessage()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java ===================================================================
RCS file: src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java diff -N src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the chat
+ * participants in a particular chat room, such as us being granded any of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of the
+ * source room participant has changed.
+ */
+ public void memberStatusChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

--Vous êtes unique, comme tout le monde!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

--
Vous êtes unique, comme tout le monde!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi Stephane,

very well structured and complete code! You've done a very good work!

I have just committed your code to the cvs. I had to make some minor
modifications so the code fit better to SIP Communicator conventions, you
could see the list of changes below.

General modifications

···

==============
- Removed special characters from author name - Stéphane was renamed to
Stephane

- Added additional comments where needed

- Renamed
  - ChatRoomLocalUserParticipationChangeEvent to
ChatRoomLocalUserPresenceChangeEvent
  - ChatRoomLocalUserParticipationListener to
ChatRoomLocalUserPresenceListener -
  - ChatRoomMemberParticipationChangeEvent to
ChatRoomMemberPresenceChangeEvent
  - ChatRoomMemberParticipationListener to ChatRoomMemberPresenceListener

After a discussion with Emil we decided to take the "Presence" name, it
appears more intuitive

ChatRoom

- Added some additional comments to setUserLimit, addBanMask, removeBanMask,
getBanList, getUserLimit - to explain some more details on what ban mask or
ban list is, what is the user limit about, etc.

- Renamed setState to addConfigParam - we renamed also the ChatRoomState
class to ChatRoomConfigParam. I had a look in the ChatRoomState class and I
would say that properties there are rather configuration patameters and not
chat room states.

- Added removeConfigParam, getSupportedConfigurationParams and
getConfiguration - in order to be able to remove a configuration parameter,
to obtain the list of configuration paramaters supported by the current
implementation and to obtain the current chat room configuration.

- Added getPassword method - it was only a setPassword.

- Removed final modifiers for String and int parameters - Java API says that
"Strings are constant; their values cannot be changed after they are
created" . And ints are not objects and they're copied by value (i.e. a
brand new copy is created and is passed to the method), so the final
modifier is redundant in this case.

ChatRoomState

- Renamed to ChatRoomConfigParam - as I already mentioned the name wasn't
very well fitting the content of the class, so we tried to make it more
intuitive

- Formatted the code - lines were longer than 80 columns

- Added additional comments

- Removed CHAT_ROOM_PASSWORD_NOT_REQUIRED, CHATROOM_INVITATION_NOT_REQUIRED,
CHATROOM_USER_NUMBER_NOT_LIMITED, CHATROOM_NOT_MUTE,
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED, CHATROOM_NOT_REGISTERED,
CHATROOM_SUBJECT_NOT_LOCKED, CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED,
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED, CHATROOM_JOIN_TIME_NOT_LIMITED, etc.

- Renamed CHAT_ROOM_USER_REGISTERED to CHAT_ROOM_ONLY_REGISTERED_USER - I
think it's more intuitive this way

- All _XXX String constants are changed to protected - they will be used
only internaly and may be by descendants

ChatRoomInvitation

- get back the name of the author of the class - should not remove the name
of the author even if the class was almost empty and we wrote the whole
implementation:)

ChatRoomPropertyChangeEvent

- get back the name of the author of the class:)

- Removed the getProtocolProvider method - the protocol provider could be
obtained from the chat room and has nothing to do in the context of this
event

- Removed the reason field - I don't think we need to have the String
reason, I don't really see for what it could be used.

- Added getOldValue and getNewValue methods - in order to be able to obtain
previous and new property values

That's all for now.

Thanks again Stephane and Loic for the great work! I'll continue with the
irc implementation now and soon we'll have all your work on cvs.

If you have any remarks on above changes you're welcome to express yourself.

Regards,
Yana

On 5/21/07, Stéphane Remy <stephane.remy@ulp.u-strasbg.fr> wrote:

Hi Yana,

I have made a lot of changes again to this services, i hope i didn't
forget something, otherwise don't hesitate to tell it to me i will
fixe it.

Quoting Yana Stamcheva <yana@sip-communicator.org>:

> Hi Stephane,
>
> Sorry for the late response. You have done really good work here. Bravo!
>
> I would propose just some minor changes to discuss:
> - In ChatRoomMemberRoleListener we should called the method
> memberRoleChanged, instead of memberStatusChanged. (I think it's a copy
> paste error)

I have changed that.

> - In ChatRoomInvitatioXXXEvent we should rename the method
> getSourceMessage to getSourceInvitation or getChatRoomInvitation,
> because actually it returns a ChatRoomInvitation.

It's fixed too.

> - After a discussion with Emil we think that it would be correct that
> ChatRoomPropertyChangeEvent extends java.beans.PropertyChangeEvent and
> thus it should implement getOldValue and getNewValue methods.

For this part i have made a lot of changes, i have used the
java.beans.PropertyChangeEvent, but i have also created a class name
ChatRoomState which contains all the possible states for a chat room.

> - We have some doubts for the name TOPIC_CHANGED. In the ChatRoom we
> already have a property called "subject", so may be it's better to call
> it SUBJECT_CHANGED here also.

It's fixed too.

> - In fact all the names of properties in the
> ChatRoomPropertyChangeEvent are not very well matching the convention
> used for property names. We should change them may be by replacing MODE
> with PROPERTY and further more by adjusting better the names so that
> they are more intuitive.

I have made them as intuitive as possible this time, but if you find
better words to make them more intuitive just tell me.

> - And finally all properties defined in the ChatRoomPropertyChangeEvent
> should also exist as properties in the ChatRoom, because they are
> actually properties of the chat room and we should be able to get and
> set their value from there.

I have changed this too.

>
> That's all for now. May be Emil will have something to add.
>
> I should say one more time congratulations for the work :slight_smile:
>
> Yana

Fot the ChatRoomState class i'm not sure if it is the best way to do,
so tell me what do you think about it.

Stéphane

here is the patch:

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * Dispatched to notify interested parties that a change in our status in
the
- * source room has changed. Changes may include us being kicked, banned,
or
- * granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomLocalUserStatusChangeEvent
-{
- public ChatRoomLocalUserStatusChangeEvent()
- {
- super();
- }
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java 23
Apr 2007 18:11:29
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in the status of the
chat
- * participants in a particular chat room, such as us being kicked,
banned, or
- * granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomMemberListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- */
- public void memberStatusChanged( ChatRoomMemberEvent evt );
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java
22 Feb 2007 12:37:18
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java
21 May 2007 07:05:35
-0000
@@ -6,22 +6,114 @@
   */
  package net.java.sip.communicator.service.protocol.event;

-import java.util.*;
+import net.java.sip.communicator.service.protocol.ChatRoom;
+import net.java.sip.communicator.service.protocol.ProtocolProviderService
;

  /**
   * <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property
of
- * the corresponding chat room (e.g. its subject or type) have been
modified.
+ * the corresponding chat room (e.g. its subject or state) have been
modified.
   * The event contains references to the source chat room and
provider, the name
   * of the property that has just changed as well as its old and new
values.
   *
- * @author Emil Ivov
+ * @author Stéphane Remy
   */
  public class ChatRoomPropertyChangeEvent
- extends EventObject
+ extends java.beans.PropertyChangeEvent
  {
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room subject being changed.
+ */
+ public static final String PROPERTY_SUBJECT_CHANGED =
"SubjectChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room ban list being changed.
+ */
+ public static final String PROPERTY_BAN_LIST_CHANGED =
"BanListChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room user limit being changed.
+ */
+ public static final String PROPERTY_USER_LIMIT_CHANGED =
"UserLimitChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room state changed.
+ */
+ public static final String PROPERTY_STATE_CHANGED = "StateChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room password being changed.
+ */
+ public static final String PROPERTY_PASSWORD_CHANGED =
"PasswordChanged";
+
+ /**
+ * An optional String indicating a possible reason why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom source,
+ String
propertyName,
+ Object oldValue,
+ Object newValue,
+ String reason)
+ {
+ super(source, propertyName, oldValue, newValue);
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with this
+ * event.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns a reference to the protocol provider where the event has
+ * originated.
+ * <p>
+ * @return a reference to the ProtocolProviderService instance where
this
+ * event originated.
+ */
+ public ProtocolProviderService getProtocolProvider()
+ {
+ return getSourceChatRoom().getParentProvider();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
      {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + this.getPropertyName()
+ + " sourceRoom="
+ + this.getSource().toString()
+ + "oldValue="
+ + this.getOldValue().toString()
+ + "newValue="
+ + this.getNewValue().toString()
+ + "]";
      }

  }
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java
23 Apr 2007 18:11:22
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,124 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-import net.java.sip.communicator.service.protocol.*;
-
-/**
- * Dispatched to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomMemberEvent
- extends EventObject
-{
- /**
- * Indicates that this event was triggered as a result of the source
- * participant joining the source chat room.
- */
- public static final String MEMBER_JOINED = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant being "kicked" out of the chat room.
- */
- public static final String MEMBER_LEFT = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant leaving the source chat room.
- */
- public static final String MEMBER_KICKED = "MemberKicked";
-
- /**
- * The member that the event relates to.
- */
- private ChatRoomMember sourceMember = null;
-
- /**
- * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
- */
- private String eventType = null;
-
- /**
- * An optional String indicating a possible reason as to why the
event
- * might have occurred.
- */
- private String reason = null;
-
- public ChatRoomMemberEvent(ChatRoom sourceRoom,
- ChatRoomMember sourceMember,
- String eventType,
- String reason )
- {
- super(sourceRoom);
- this.sourceMember = sourceMember;
- this.eventType = eventType;
- this.reason = reason;
- }
-
- /**
- * Returns the source chat room for this event.
- *
- * @return the <tt>ChatRoom</tt> associated with that is the
source of this
- * event and that the corresponding ChatRoomMemberBelongs to.
- */
- public ChatRoom getChatRoom()
- {
- return (ChatRoom)getSource();
- }
-
- /**
- * Returns the member that this event is pertaining to.
- * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
- */
- public ChatRoomMember getChatRoomMember()
- {
- return sourceMember;
- }
-
- /**
- * A reason string indicating a human readable reason for this event.
- *
- * @return a human readable String containing the reason for this
event,
- * or null if no particular reason was specified.
- */
- public String getReason()
- {
- return reason;
- }
-
- /**
- * Returns the type of this event which could be one of the
MEMBER_XXX-ed
- * member field values.
- *
- * @return one of the MEMBER_XXXed member field values indicating
the type
- * of this event.
- */
- public String getEventType()
- {
- return eventType;
- }
-
- /**
- * Returns a String representation of this event.
- */
- public String toString()
- {
- return "ChatRoomMemberEvent[type="
- + getEventType()
- + " sourceRoom="
- + getChatRoom()
- + " member="
- + getChatRoomMember()
- + "]";
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java
22 Feb 2007 12:36:09
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in our status in the
room
- * such as us being kicked, banned, or granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomLocalUserStatusListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in our status in
the
- * source soom has changed. Changes may include us being kicked,
banned, or
- * granted admin permissions.
- */
- public void
localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt);
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java
23 Apr 2007 18:11:36
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java
21 May 2007 07:05:35
-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
  package net.java.sip.communicator.service.protocol.event;

  import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
  /**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
   *
   * @author Emil Ivov
+ * @author Stéphane Remy
   */
  public class ChatRoomMemberRoleChangeEvent
      extends EventObject
  {
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMember sourceMember,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
      {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
      }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
  }
Index:
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
---
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22
Feb
2007 12:35:34 -0000 1.1
+++
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 21
May
2007 07:05:34 -0000
@@ -7,13 +7,42 @@
  package net.java.sip.communicator.service.protocol;

  /**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a
chat room member
+ * to an other in order to invite this chat room member to join the
chat room this invitation
+ * have for target.
+ *
+ * @author Stéphane Remy
   */
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
  {
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no
reason
+ *
+ * @return the reason of this invitation, or null if there is no
reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the
invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the
invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation
has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that
created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
  }
Index:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
---
src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
22
Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat
room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if
no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/ChatRoom.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoom.java,v
retrieving revision 1.4
diff -u -r1.4 ChatRoom.java
--- src/net/java/sip/communicator/service/protocol/ChatRoom.java 24
Apr 2007 12:31:25 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/ChatRoom.java 21
May 2007 07:05:34 -0000
@@ -17,7 +17,6 @@
   */
  public interface ChatRoom
  {
-
      /**
       * Returns the name of this <tt>ChatRoom</tt>.
       *
@@ -95,25 +94,6 @@
      public void leave();

      /**
- * Adds <tt>listener</tt> to the list of listeners registered to
receive
- * events upon modification of chat room properties such as its
subject
- * for example.
- *
- * @param listener ChatRoomChangeListener
- */
- public void addChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
- * Removes <tt>listener</tt> from the list of listeneres current
registered
- * for chat room modification events.
- *
- * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
- */
- public void removeChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
       * Returns the last known room subject/theme or <tt>null</tt> if the
user
       * hasn't joined the room or the room does not have a subject yet.
       * <p>
@@ -163,41 +143,88 @@
         throws OperationFailedException;

     /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
      *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
      */
- public void addLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void addLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

     /**
- * Removes a listener that was being notified of changes in our status
in
- * the room such as us being kicked, banned, or granted admin
permissions.
+ * Removes a listener that was being notified of changes in our
participation in
+ * the room such as us being kicked, join, left...
      *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
      */
- public void removeLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void removeLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

     /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left...
      *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
      */
- public void addMemberListener(ChatRoomMemberListener listener);
+ public void
addMemberParticipationListener(ChatRoomMemberParticipationListener
listener);

     /**
- * Removes a listener that was being notified of changes in the status
of
- * other chat room participants such as users being kicked, banned, or
- * granted admin permissions.
+ * Removes a listener that was being notified of changes in the
participation of
+ * other chat room participants such as users being kicked, join,
left.
      *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
      */
- public void removeMemberListener(
- ChatRoomMemberListener listener);
-
+ public void
removeMemberParticipationListener(ChatRoomMemberParticipationListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in our role
in the room
+ * such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in our role
in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes of a member
role in the room
+ * such as being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void addMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Removes a listener that was being notified of changes of a
member role in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void removeMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in the
property of the room
+ * such as the subject being change or the room state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
addPropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in the
property of
+ * the chat room such as the subject being change or the room
state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
removePropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
      /**
       * Invites another user to this room.
       * <p>
@@ -285,6 +312,82 @@
       */
      public ProtocolProviderService getParentProvider();

- //include - roominfo
- /** @todo include room info */
+ /**
+ * Sets the password of this chat room. If the user does not have
the right
+ * to change the room password, or the protocol does not support
this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param password the new password that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setPassword(final String password)
+ throws OperationFailedException;
+
+ /**
+ * Adds a ban mask to the list fo ban masks of this chat room. If
the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the new ban mask that we'd like to add to this
room ban list
+ * @throws OperationFailedException
+ */
+ public void addBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Remove a ban mask of the list fo ban masks of this chat room.
If the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the ban mask that we'd like to remove from this
room ban list
+ * @throws OperationFailedException
+ */
+ public void removeBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Sets the user limit of this chat room. If the user does not
have the right
+ * to change the room user limit, or the protocol does not
support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param userLimit the new user limit that we'd like this room to
have
+ * @throws OperationFailedException
+ */
+ public void setUserLimit(final int userLimit)
+ throws OperationFailedException;
+
+ /**
+ * Sets a state of this chat room. If the user does not have the
right
+ * to change the room state, or the protocol does not support this,
or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param state the new state that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setState(ChatRoomState state)
+ throws OperationFailedException;
+
+ /**
+ * Returns the list of ban mask that are currently of this chat room.
+ * @return List the ban list of this room.
+ */
+ public List getBanList();
+
+ /**
+ * Returns the list of states that this chat room is currently in.
+ * @return List the list of states of this chat room.
+ */
+ public List getStateList();
+
+ /**
+ * Returns the limit of user of this chat room, of returns -1 if
there is
+ * no limit.
+ * @return List the list of states of this chat room.
+ */
+ public int getUserLimit();
  }
Index:

src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v
retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
---
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java
23 Apr 2007 18:12:44
-0000 1.4
+++
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java
21 May 2007 07:05:35
-0000
@@ -45,11 +45,11 @@
      public List getCurrentlyJoinedChatRooms();

      /**
- * Returns a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
       * currently active in.
       *
- * @param contact the contact whose current ChatRooms we will be
querying.
- * @return a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * @param chatRoomMember the chatRoomMember whose current
ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
       * currently active in.
       *
       * @throws OperationFailedException if an error occurs while trying
to
@@ -57,7 +57,7 @@
       * @throws OperationNotSupportedException if the server does not
support
       * multi user chat
       */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember
chatRoomMember)
          throws OperationFailedException, OperationNotSupportedException;

      /**
@@ -110,7 +110,7 @@
       *
       * @param listener an invitation listener.
       */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener
listener);

      /**
       * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
       *
       * @param listener the invitation listener to remove.
       */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener
listener);

      /**
       * Adds a listener to invitation notifications. The listener
will be fired
@@ -127,7 +127,7 @@
       * @param listener an invitation listener.
       */
      public void addInvitationRejectionListener(
- InvitationRejectionListener
listener);
+
ChatRoomInvitationRejectionListener listener);

      /**
       * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,14 +136,5 @@
       * @param listener the invitation listener to remove.
       */
      public void removeInvitationRejectionListener(
- InvitationRejectionListener
listener);
-
- /**
- * Returns true if <tt>contact</tt> supports multi user chat
sessions.
- *
- * @param contact reference to the contact whose support for chat
rooms
- * we are currently querying.
- * @return a boolean indicating whether <tt>contact</tt> supports
chatrooms.
- */
- public boolean isMultiChatSupportedByContact(Contact contact);
+
ChatRoomInvitationRejectionListener listener);
  }
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,25 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomLocalUserParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in our
participation in the
+ * source soom has occured. Changes may include us being kicked,
join, left.
+ */
+ public void
localUserParticipationChanged(ChatRoomLocalUserParticipationChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room
is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that
contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void
invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,28 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomLocalUserRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,112 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.EventObject;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our
paticipation in the
+ * source room has occured. Changes may include us being kicked,
join, left...
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserParticipationChangeEvent(ChatRoom sourceRoom,
+
String eventType,
+
String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,131 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in the
participation of the
+ * source room participant has changed. Changes may include the
participant
+ * being kicked, join, left...
+ *
+ * @author Emil Ivov
+ */
+public class ChatRoomMemberParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomMemberParticipationChangeEvent(ChatRoom
sourceRoom,
+ ChatRoomMember sourceMember,
+ String eventType,
+ String reason )
+ {
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getChatRoomMember()
+ {
+ return sourceMember;
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomMemberEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom().toString()
+ + " member="
+ + getChatRoomMember().toString()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which
was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by
us.
+ *
+ * @param evt the instance of the
<tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the
participation of the chat
+ * member in a particular chat room, such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomMemberParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the
participation of the
+ * source room member has changed. Changes may include the
participant
+ * being kicked, join, left.
+ */
+ public void
memberParticipationChanged(ChatRoomMemberParticipationChangeEvent evt );
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a
rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is
no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt>
representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,77 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserRoleChangeEvent
+ extends EventObject
+{
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
+ {
+ super(sourceRoom);
+ this.previousRole = previousRole;
+ this.newRole = newRole;
+ }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing
reception of the
+ * <tt>source</tt> invitation received from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/ChatRoomState.java

RCS file:
src/net/java/sip/communicator/service/protocol/ChatRoomState.java
diff -N src/net/java/sip/communicator/service/protocol/ChatRoomState.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/ChatRoomState.java 1
Jan 1970 00:00:00 -0000
@@ -0,0 +1,589 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+/**
+ * The ChatRoomState class reflects the current state of a chat room.
+ *
+ * @author Stéphane Remy
+ */
+public class ChatRoomState
+{
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_VISIBLE state.
+ * <p>
+ * This constant has the String value "Visible".
+ */
+ public static final String _CHATROOM_VISIBLE = "Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_VISIBLE = new
ChatRoomState(_CHATROOM_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Not Visible".
+ */
+ public static final String _CHATROOM_NOT_VISIBLE = "Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_VISIBLE = new
ChatRoomState(_CHATROOM_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Required".
+ */
+ public static final String _CHATROOM_PASSWORD_REQUIRED = "Password
Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_REQUIRED = new
ChatRoomState(_CHATROOM_PASSWORD_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Not Required".
+ */
+ public static final String _CHATROOM_PASSWORD_NOT_REQUIRED =
"Password Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_NOT_REQUIRED =
new ChatRoomState(_CHATROOM_PASSWORD_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Required".
+ */
+ public static final String _CHATROOM_INVITATION_REQUIRED =
"Invitation Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUIRED =
new
ChatRoomState(_CHATROOM_INVITATION_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Not Required".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_REQUIRED =
"Invitation Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_REQUIRED

new ChatRoomState(_CHATROOM_INVITATION_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_LIMITED = "User
Number Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_LIMITED =
new
ChatRoomState(_CHATROOM_USER_NUMBER_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Not Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_NOT_LIMITED =
"User
Number Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_NOT_LIMITED

new ChatRoomState(_CHATROOM_USER_NUMBER_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MUTE state.
+ * <p>
+ * This constant has the String value "Mute".
+ */
+ public static final String _CHATROOM_MUTE = "Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * mute state no messages are get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_MUTE = new
ChatRoomState(_CHATROOM_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_MUTE state.
+ * <p>
+ * This constant has the String value "Not Mute".
+ */
+ public static final String _CHATROOM_NOT_MUTE = "Not Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * mute state messages can be get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_NOT_MUTE = new
ChatRoomState(_CHATROOM_NOT_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_ALLOWED =
"External Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * external messages allowed state, this chat room can receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Not
Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED

"External Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * external messages allowed state, this chat room can not receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_REGISTERED state.
+ * <p>
+ * This constant has the String value "Registered".
+ */
+ public static final String _CHATROOM_REGISTERED = "Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_REGISTERED = new
ChatRoomState(_CHATROOM_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Not Registered".
+ */
+ public static final String _CHATROOM_NOT_REGISTERED = "Not
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_REGISTERED = new
ChatRoomState(_CHATROOM_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Locked".
+ */
+ public static final String _CHATROOM_SUBJECT_LOCKED = "Subject
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * subject locked state, only admin users can change the subject
of
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_LOCKED = new
ChatRoomState(_CHATROOM_SUBJECT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Not locked".
+ */
+ public static final String _CHATROOM_SUBJECT_NOT_LOCKED = "Subject
Not locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * subject locked state, all users can change the subject of this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_NOT_LOCKED =
new
ChatRoomState(_CHATROOM_SUBJECT_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_ALLOWED =
"Message Format Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format allowed, all colored, underlined... messages are
allowed.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_ALLOWED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Not Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED =
"Message Format Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format not allowed, all colored, underlined... messages
are not allowed.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_FILTERED =
"Message Format Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format filtered state, all colored, underlined...
messages are seen in standard format
+ * by other users.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_FILTERED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Not Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_FILTERED =
"Message Format Not Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * message format filtered state, all colored, underlined...
messages are seen
+ * by other users.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_LIMITED = "Join
Time
Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * join time limited state, users can only join in an interval of
X time.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_LIMITED = new
ChatRoomState(_CHATROOM_JOIN_TIME_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Not Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_NOT_LIMITED = "Join
Time Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * join time limited state.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_NOT_LIMITED =
new ChatRoomState(_CHATROOM_JOIN_TIME_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_REQUEST_ALLOWED =
"Invitation Request Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation request allowed state, all invitation request are
allowed.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Not
Allowed".
+ */
+ public static final String
_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED
= "Invitation Request Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation request allowed state, all invitation request are
rejected.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Redirected".
+ */
+ public static final String _CHATROOM_USER_REDIRECTED = "User
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * user redirected state, all users which join this chat room are
redirected to an other one.
+ */
+ public static final ChatRoomState CHATROOM_USER_REDIRECTED = new
ChatRoomState(_CHATROOM_USER_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NOT_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Not Redirected".
+ */
+ public static final String _CHATROOM_USER_NOT_REDIRECTED = "User
Not
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * user redirected state, all users which join this chat room are
not redirected.
+ */
+ public static final ChatRoomState CHATROOM_USER_NOT_REDIRECTED =
new
ChatRoomState(_CHATROOM_USER_NOT_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_LOCKED = "Nicknames
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nicknames locked state, users in this chat room can not change
their nickname.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_LOCKED = new
ChatRoomState(_CHATROOM_NICKNAMES_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Not Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_NOT_LOCKED =
"Nicknames Not Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nicknames locked state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_NOT_LOCKED =
new ChatRoomState(_CHATROOM_NICKNAMES_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Locked".
+ */
+ public static final String _CHATROOM_KICK_LOCKED = "Kick Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * kick locked state, kicks are locked on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_KICK_LOCKED = new
ChatRoomState(_CHATROOM_KICK_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Not Locked".
+ */
+ public static final String _CHATROOM_KICK_NOT_LOCKED = "Kick Not
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * kick locked state.
+ */
+ public static final ChatRoomState CHATROOM_KICK_NOT_LOCKED = new
ChatRoomState(_CHATROOM_KICK_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Registered".
+ */
+ public static final String _CHATROOM_USERS_REGISTERED = "Users
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * users registered state, only registered users can join this
room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_REGISTERED = new
ChatRoomState(_CHATROOM_USERS_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Not Registered".
+ */
+ public static final String _CHATROOM_USERS_NOT_REGISTERED = "Users
Not Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * users registered state, all users can join this chat room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_NOT_REGISTERED =
new ChatRoomState(_CHATROOM_USERS_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_ALLOWED =
"Special Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * special messages allowed state.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Not Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED

"Special Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * special messages allowed state, only a specific level type of
message are allowed.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_VISIBLE =
"Nickname List Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAME_LIST_VISIBLE =
new ChatRoomState(_CHATROOM_NICKNAME_LIST_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Not Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_NOT_VISIBLE =
"Nickname List Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState
CHATROOM_NICKNAME_LIST_NOT_VISIBLE
= new ChatRoomState(_CHATROOM_NICKNAME_LIST_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_ALLOWED =
"Invitation Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * invitation allowed state, users can invite other users in this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_ALLOWED =
new
ChatRoomState(_CHATROOM_INVITATION_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Not Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_ALLOWED =
"Invitation Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * invitation allowed state, users can not invite other users in
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_ALLOWED

new ChatRoomState(_CHATROOM_INVITATION_NOT_ALLOWED);
+
+ /**
+ * A string representation of this Chat Room State.
+ */
+ private String chatRoomStateStr;
+
+ /**
+ * Create a chat room state object with a value corresponding to
the specified
+ * string.
+ * @param chatRoomState a string representation of the state.
+ */
+ private ChatRoomState(String chatRoomState)
+ {
+ this.chatRoomStateStr = chatRoomState;
+ }
+
+ /**
+ * Returns a String representation of that chat room State.
+ *
+ * @return a string value (one of the _CHATROOM_XXX constants)
representing
+ * this chat room state).
+ */
+ public String getStateString()
+ {
+ return chatRoomStateStr;
+ }
+
+ /**
+ * Returns a string represenation of this call state. Strings
returned
+ * by this method have the following format:
+ * "ChatRoomState:<STATE_STRING>" and are meant to be used for
loggin/debugging
+ * purposes.
+ * @return a string representation of this object.
+ */
+ public String toString()
+ {
+ return getClass().getName()+":"+getStateString();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

>
> Stéphane Remy wrote:
>> Hello,
>>
>> Emil, Yana
>>
>> I've changed some of the services and events, related to the chat
>> rooms, all i've changed isn't already implemented for irc but i
>> want you to take a look and tell me if you are ok with what i've
>> done and maybe add it to sc :).
>>
>> And if someone else has an idee about changes, additions to do
>> about multi user chat you are welcome on this thread :wink:
>>
>> Stéphane
>>
>> ### Eclipse Workspace Patch 1.0
>> #P sip-communicator
>> Index:
>>
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java
>> ===================================================================
>> RCS file:
>>
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java
diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java
---
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22
Feb 2007 12:37:47 -0000
>> 1.1
>> +++ /dev/null 1 Jan 1970 00:00:00 -0000
>> @@ -1,26 +0,0 @@
>> -/*
>> - * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
>> - *
>> - * Distributable under LGPL license.
>> - * See terms of license at gnu.org.
>> - */
>> -package net.java.sip.communicator.service.protocol.event;
>> -
>> -import java.util.*;
>> -
>> -/**
>> - *
>> - * @author Emil Ivov
>> - */
>> -public class InvitationRejectedEvent
>> - extends EventObject
>> -{
>> - public InvitationRejectedEvent(Object source)
>> - {
>> - super(source);
>> - }
>> -
>> - public static void main(String[] args)
>> - {
>> - }
>> -}
>> Index:
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java
>> ===================================================================
>> RCS file:
>>
/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v
retrieving revision
>> 1.1
>> diff -u -r1.1 ChatRoomPropertyChangeEvent.java
>> ---
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22
Feb 2007 12:37:18 -0000
>> 1.1
>> +++
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16
May 2007 08:35:07
>> -0000
>> @@ -7,6 +7,7 @@
>> package net.java.sip.communicator.service.protocol.event;
>>
>> import java.util.*;
>> +import net.java.sip.communicator.service.protocol.*;
>>
>> /**
>> * <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property
of
>> @@ -14,14 +15,159 @@
>> * The event contains references to the source chat room and
>> provider, the name
>> * of the property that has just changed as well as its old and new
values.
>> *
>> - * @author Emil Ivov
>> + * @author Stéphane Remy
>> */
>> public class ChatRoomPropertyChangeEvent
>> extends EventObject
>> {
>> - public ChatRoomPropertyChangeEvent(Object source)
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room topic being changed, that means the subject of
>> this channel
>> + * has changed
>> + */
>> + public static final String TOPIC_CHANGED = "TopicChanged";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room being set in mode private, that means the channel
>> is now no more
>> + * visible in the list of channels
>> + */
>> + public static final String MODE_PRIVATE = "ModePrivate";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room being set in mode secret, that means the channel
>> is now no more
>> + * visible in the list of channels and no one can make a
>> request on this channel
>> + * in order to see if it exists like in irc a whois on a
>> channel if it is in mode
>> + * secret don't response.
>> + */
>> + public static final String MODE_SECRET = "ModeSecret";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room being set in mode invite only, that means the
>> channel can only
>> + * be joined by invited members.
>> + */
>> + public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room being set in mode topic protected, that means the
>> channel topic can only
>> + * be changed by operators.
>> + */
>> + public static final String MODE_TOPIC_PROTECTED =
"ModeTopicProtected";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room being set in mode chat room message only, that
>> means the channel can only receive
>> + * messages from a user that is on this channel.
>> + */
>> + public static final String MODE_CHAT_ROOM_MESSAGE_ONLY =
>> "ModeChatRoomMessageOnly";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room being set in mode moderated, that means only user
>> that have
>> + * enough level in this room can send messages.
>> + */
>> + public static final String MODE_MODERATED = "ModeModerated";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room being set in mode max user, that means only a max
>> number of
>> + * members can join this chat room.
>> + */
>> + public static final String MODE_MAX_USER = "ModeMaxUser";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * chat room being set in mode key, that means that all members
need
>> + * a key to join this channel.
>> + */
>> + public static final String MODE_KEY = "ModeKey";
>> +
>> + /**
>> + * The type of this event. Values can be any of the above fields.
>> + */
>> + private String eventType = null;
>> +
>> + /**
>> + * An optional String indicating a possible content of the event
>> + * that have occurred, like if a key is set, or a max user
number...
>> + */
>> + private String content = null;
>> +
>> + /**
>> + * An optional String indicating a possible reason as to why the
event
>> + * might have occurred.
>> + */
>> + private String reason = null;
>> +
>> + public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
>> + String eventType,
>> + String content,
>> + String reason)
>> + {
>> + super(sourceRoom);
>> + this.eventType = eventType;
>> + this.content = content;
>> + this.reason = reason;
>> + }
>> +
>> + /**
>> + * Returns the source chat room for this event.
>> + *
>> + * @return the <tt>ChatRoom</tt> associated with that is the
>> source of this
>> + * event.
>> + */
>> + public ChatRoom getChatRoom()
>> + {
>> + return (ChatRoom)getSource();
>> + }
>> +
>> + /**
>> + * A reason string indicating a human readable reason for this
event.
>> + *
>> + * @return a human readable String containing the reason for
>> this event,
>> + * or null if no particular reason was specified.
>> + */
>> + public String getReason()
>> + {
>> + return reason;
>> + }
>> +
>> + /**
>> + * Returns the type of this event which could be one of the above
>> + * field values.
>> + *
>> + * @return one of the field values indicating the type
>> + * of this event.
>> + */
>> + public String getEventType()
>> + {
>> + return eventType;
>> + }
>> +
>> + /**
>> + * A reason string indicating the content of this event.
>> + *
>> + * @return a human readable String containing the content for
>> this event,
>> + * or null if no particular content was specified.
>> + */
>> + public String getContent()
>> + {
>> + return content;
>> + }
>> +
>> + /**
>> + * Returns a String representation of this event.
>> + */
>> + public String toString()
>> {
>> - super(source);
>> + return "ChatRoomPropertyChangeEvent[type="
>> + + getEventType()
>> + + " sourceRoom="
>> + + getChatRoom()
>> + + "]";
>> }
>>
>> }
>> Index:
>>
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
>> ===================================================================
>> RCS file:
>>
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
---
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
22 Feb 2007 12:37:33 -0000
>> 1.1
>> +++ /dev/null 1 Jan 1970 00:00:00 -0000
>> @@ -1,24 +0,0 @@
>> -/*
>> - * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
>> - *
>> - * Distributable under LGPL license.
>> - * See terms of license at gnu.org.
>> - */
>> -package net.java.sip.communicator.service.protocol.event;
>> -
>> -/**
>> - * A listener that is fired anytime an invitation to join a MUC
>> room is received.
>> - *
>> - * @author Emil Ivov
>> - */
>> -public interface InvitationListener
>> -{
>> - /**
>> - * Called when we receive an invitation to join an existing
ChatRoom.
>> - * <p>
>> - * @param evt the <tt>InvitationReceivedEvent</tt> that
>> contains the newly
>> - * received invitation and its source provider.
>> - */
>> - public abstract void invitationReceived(InvitationReceivedEvent
evt);
>> -
>> -}
>> Index:
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java
>> ===================================================================
>> RCS file:
>>
/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v
retrieving revision
>> 1.1
>> diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
>> ---
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23
Apr 2007 18:11:36 -0000
>> 1.1
>> +++
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16
May 2007 08:35:07
>> -0000
>> @@ -1,23 +1,94 @@
>> +/*
>> + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
>> + *
>> + * Distributable under LGPL license.
>> + * See terms of license at gnu.org.
>> + */
>> package net.java.sip.communicator.service.protocol.event;
>>
>> import java.util.*;
>>
>> +import net.java.sip.communicator.service.protocol.*;
>> +
>> /**
>> - * <p> </p>
>> - *
>> - * <p> </p>
>> - *
>> - * <p> </p>
>> - *
>> - * <p> </p>
>> + * Dispatched to notify interested parties that a change in our role
in the
>> + * source room has changed. Changes may include us being granted
>> admin permissions,
>> + * or other permissions.
>> + *
>> + * @see ChatRoomMemberRole
>> *
>> * @author Emil Ivov
>> + * @author Stéphane Remy
>> */
>> public class ChatRoomMemberRoleChangeEvent
>> extends EventObject
>> {
>> - public ChatRoomMemberRoleChangeEvent(Object source)
>> + /**
>> + * The member that the event relates to.
>> + */
>> + private ChatRoomMember sourceMember = null;
>> +
>> + /**
>> + * The previous role that this member had.
>> + */
>> + private ChatRoomMemberRole previousRole = null;
>> +
>> + /**
>> + * The new role that this member get.
>> + */
>> + private ChatRoomMemberRole newRole = null;
>> +
>> + public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
>> + ChatRoomMember sourceMember,
>> + ChatRoomMemberRole
previousRole,
>> + ChatRoomMemberRole newRole)
>> {
>> - super(source);
>> + super(sourceRoom);
>> + this.sourceMember = sourceMember;
>> + this.previousRole = previousRole;
>> + this.newRole = newRole;
>> }
>> +
>> + /**
>> + * Returns the new role given to this member.
>> + *
>> + * @return newRole the new role given to this member for this chat
>> + * room.
>> + */
>> + public ChatRoomMemberRole getNewRole()
>> + {
>> + return newRole;
>> + }
>> +
>> + /**
>> + * Returns the previous role that this member had in this
>> + * chat room.
>> + *
>> + * @return previousRole the previous role that this member
>> + * had in this chat room.
>> + */
>> + public ChatRoomMemberRole getPreviousRole()
>> + {
>> + return previousRole;
>> + }
>> +
>> + /**
>> + * Returns the source chat room for this event.
>> + *
>> + * @return the <tt>ChatRoom</tt> associated with that is the
>> source of this
>> + * event and that the corresponding ChatRoomMemberBelongs to.
>> + */
>> + public ChatRoom getChatRoom()
>> + {
>> + return (ChatRoom)getSource();
>> + }
>> +
>> + /**
>> + * Returns the member that this event is pertaining to.
>> + * @return the <tt>ChatRoomMember</tt> that this event is
>> pertaining to.
>> + */
>> + public ChatRoomMember getSourceMember()
>> + {
>> + return sourceMember;
>> + }
>> }
>> Index:
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java
>> ===================================================================
>> RCS file:
>>
/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v
retrieving revision
>> 1.1
>> diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
>> ---
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02 -0000
>> 1.1
>> +++
>>
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16
May 2007 08:35:07
>> -0000
>> @@ -6,18 +6,109 @@
>> */
>> package net.java.sip.communicator.service.protocol.event;
>>
>> +import java.util.EventObject;
>> +
>> +import net.java.sip.communicator.service.protocol.*;
>> +
>> /**
>> * Dispatched to notify interested parties that a change in our
>> status in the
>> * source room has changed. Changes may include us being kicked,
banned, or
>> * granted admin permissions.
>> *
>> * @author Emil Ivov
>> + * @author Stéphane Remy
>> */
>> public class ChatRoomLocalUserStatusChangeEvent
>> + extends EventObject
>> {
>> - public ChatRoomLocalUserStatusChangeEvent()
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * participant joining the source chat room.
>> + */
>> + public static final String MEMBER_JOINED = "MemberJoined";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * participant being "kicked" out of the chat room.
>> + */
>> + public static final String MEMBER_LEFT = "MemberLeft";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * participant leaving the source chat room.
>> + */
>> + public static final String MEMBER_KICKED = "MemberKicked";
>> +
>> + /**
>> + * Indicates that this event was triggered as a result of the
source
>> + * participant beein deconnected from the server brutally, or
>> ping timeout.
>> + */
>> + public static final String MEMBER_QUIT = "MemberQuit";
>> +
>> + /**
>> + * The type of this event. Values can be any of the
>> MEMBER_XXX-ED fields.
>> + */
>> + private String eventType = null;
>> +
>> + /**
>> + * An optional String indicating a possible reason as to why the
event
>> + * might have occurred.
>> + */
>> + private String reason = null;
>> +
>> + public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
>> + String eventType,
>> + String reason)
>> {
>> - super();
>> + super(sourceRoom);
>> + this.eventType = eventType;
>> + this.reason = reason;
>> }
>>
>> + /**
>> + * Returns the source chat room for this event.
>> + *
>> + * @return the <tt>ChatRoom</tt> associated with that is the
>> source of this
>> + * event and that the corresponding ChatRoomMemberBelongs to.
>> + */
>> + public ChatRoom getChatRoom()
>> + {
>> + return (ChatRoom)getSource();
>> + }
>> +
>> + /**
>> + * A reason string indicating a human readable reason for this
event.
>> + *
>> + * @return a human readable String containing the reason for
>> this event,
>> + * or null if no particular reason was specified.
>> + */
>> + public String getReason()
>> + {
>> + return reason;
>> + }
>> +
>> + /**
>> + * Returns the type of this event which could be one of the
>> MEMBER_XXX-ed
>> + * member field values.
>> + *
>> + * @return one of the MEMBER_XXXed member field values
>> indicating the type
>> + * of this event.
>> + */
>> + public String getEventType()
>> + {
>> + return eventType;
>> + }
>> +
>> + /**
>> + * Returns a String representation of this event.
>> + */
>> + public String toString()
>> + {
>> + return "ChatRoomLocalUserStatusChangeEvent[type="
>> + + getEventType()
>> + + " sourceRoom="
>> + + getChatRoom()
>> + + "]";
>> + }
>> }
>> Index:
>> src/net/java/sip/communicator/service/protocol/event...

[Message clipped]


#5

Hi Yana,

Sorry for the late answer. I updated my code with your changes and i'm ok with all you've done. I just noticed two things you forgot to change:

In ChatRoomPropertyChangeEvent:

You forgot to change PROPERTY_STATE_CHANGED into PROPERTY_CONFIG_CHANGED.

In ChatRoomConfigParam:

You forgot to remove _CHAT_ROOM_NOT_VISIBLE.

Stéphane

Yana Stamcheva <yana@sip-communicator.org> a écrit :

···

Hi Stephane,

very well structured and complete code! You've done a very good work!

I have just committed your code to the cvs. I had to make some minor
modifications so the code fit better to SIP Communicator conventions, you
could see the list of changes below.

General modifications

- Removed special characters from author name - Stéphane was renamed to
Stephane

- Added additional comments where needed

- Renamed
- ChatRoomLocalUserParticipationChangeEvent to
ChatRoomLocalUserPresenceChangeEvent
- ChatRoomLocalUserParticipationListener to
ChatRoomLocalUserPresenceListener -
- ChatRoomMemberParticipationChangeEvent to
ChatRoomMemberPresenceChangeEvent
- ChatRoomMemberParticipationListener to ChatRoomMemberPresenceListener

After a discussion with Emil we decided to take the "Presence" name, it
appears more intuitive

ChatRoom

- Added some additional comments to setUserLimit, addBanMask, removeBanMask,
getBanList, getUserLimit - to explain some more details on what ban mask or
ban list is, what is the user limit about, etc.

- Renamed setState to addConfigParam - we renamed also the ChatRoomState
class to ChatRoomConfigParam. I had a look in the ChatRoomState class and I
would say that properties there are rather configuration patameters and not
chat room states.

- Added removeConfigParam, getSupportedConfigurationParams and
getConfiguration - in order to be able to remove a configuration parameter,
to obtain the list of configuration paramaters supported by the current
implementation and to obtain the current chat room configuration.

- Added getPassword method - it was only a setPassword.

- Removed final modifiers for String and int parameters - Java API says that
"Strings are constant; their values cannot be changed after they are
created" . And ints are not objects and they're copied by value (i.e. a
brand new copy is created and is passed to the method), so the final
modifier is redundant in this case.

ChatRoomState

- Renamed to ChatRoomConfigParam - as I already mentioned the name wasn't
very well fitting the content of the class, so we tried to make it more
intuitive

- Formatted the code - lines were longer than 80 columns

- Added additional comments

- Removed CHAT_ROOM_PASSWORD_NOT_REQUIRED, CHATROOM_INVITATION_NOT_REQUIRED,
CHATROOM_USER_NUMBER_NOT_LIMITED, CHATROOM_NOT_MUTE,
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED, CHATROOM_NOT_REGISTERED,
CHATROOM_SUBJECT_NOT_LOCKED, CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED,
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED, CHATROOM_JOIN_TIME_NOT_LIMITED, etc.

- Renamed CHAT_ROOM_USER_REGISTERED to CHAT_ROOM_ONLY_REGISTERED_USER - I
think it's more intuitive this way

- All _XXX String constants are changed to protected - they will be used
only internaly and may be by descendants

ChatRoomInvitation

- get back the name of the author of the class - should not remove the name
of the author even if the class was almost empty and we wrote the whole
implementation:)

ChatRoomPropertyChangeEvent

- get back the name of the author of the class:)

- Removed the getProtocolProvider method - the protocol provider could be
obtained from the chat room and has nothing to do in the context of this
event

- Removed the reason field - I don't think we need to have the String
reason, I don't really see for what it could be used.

- Added getOldValue and getNewValue methods - in order to be able to obtain
previous and new property values

That's all for now.

Thanks again Stephane and Loic for the great work! I'll continue with the
irc implementation now and soon we'll have all your work on cvs.

If you have any remarks on above changes you're welcome to express yourself.

Regards,
Yana

On 5/21/07, Stéphane Remy <stephane.remy@ulp.u-strasbg.fr> wrote:

Hi Yana,

I have made a lot of changes again to this services, i hope i didn't
forget something, otherwise don't hesitate to tell it to me i will
fixe it.

Quoting Yana Stamcheva <yana@sip-communicator.org>:

Hi Stephane,

Sorry for the late response. You have done really good work here. Bravo!

I would propose just some minor changes to discuss:
- In ChatRoomMemberRoleListener we should called the method
memberRoleChanged, instead of memberStatusChanged. (I think it's a copy
paste error)

I have changed that.

- In ChatRoomInvitatioXXXEvent we should rename the method
getSourceMessage to getSourceInvitation or getChatRoomInvitation,
because actually it returns a ChatRoomInvitation.

It's fixed too.

- After a discussion with Emil we think that it would be correct that
ChatRoomPropertyChangeEvent extends java.beans.PropertyChangeEvent and
thus it should implement getOldValue and getNewValue methods.

For this part i have made a lot of changes, i have used the
java.beans.PropertyChangeEvent, but i have also created a class name
ChatRoomState which contains all the possible states for a chat room.

- We have some doubts for the name TOPIC_CHANGED. In the ChatRoom we
already have a property called "subject", so may be it's better to call
it SUBJECT_CHANGED here also.

It's fixed too.

- In fact all the names of properties in the
ChatRoomPropertyChangeEvent are not very well matching the convention
used for property names. We should change them may be by replacing MODE
with PROPERTY and further more by adjusting better the names so that
they are more intuitive.

I have made them as intuitive as possible this time, but if you find
better words to make them more intuitive just tell me.

- And finally all properties defined in the ChatRoomPropertyChangeEvent
should also exist as properties in the ChatRoom, because they are
actually properties of the chat room and we should be able to get and
set their value from there.

I have changed this too.

That's all for now. May be Emil will have something to add.

I should say one more time congratulations for the work :slight_smile:

Yana

Fot the ChatRoomState class i'm not sure if it is the best way to do,
so tell me what do you think about it.

Stéphane

here is the patch:

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * Dispatched to notify interested parties that a change in our status in
the
- * source room has changed. Changes may include us being kicked, banned,
or
- * granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomLocalUserStatusChangeEvent
-{
- public ChatRoomLocalUserStatusChangeEvent()
- {
- super();
- }
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java 23
Apr 2007 18:11:29
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in the status of the
chat
- * participants in a particular chat room, such as us being kicked,
banned, or
- * granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomMemberListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- */
- public void memberStatusChanged( ChatRoomMemberEvent evt );
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java
22 Feb 2007 12:37:18
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java
21 May 2007 07:05:35
-0000
@@ -6,22 +6,114 @@
  */
package net.java.sip.communicator.service.protocol.event;

-import java.util.*;
+import net.java.sip.communicator.service.protocol.ChatRoom;
+import net.java.sip.communicator.service.protocol.ProtocolProviderService
;

/**
  * <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property
of
- * the corresponding chat room (e.g. its subject or type) have been
modified.
+ * the corresponding chat room (e.g. its subject or state) have been
modified.
  * The event contains references to the source chat room and
provider, the name
  * of the property that has just changed as well as its old and new
values.
  *
- * @author Emil Ivov
+ * @author Stéphane Remy
  */
public class ChatRoomPropertyChangeEvent
- extends EventObject
+ extends java.beans.PropertyChangeEvent
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room subject being changed.
+ */
+ public static final String PROPERTY_SUBJECT_CHANGED =
"SubjectChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room ban list being changed.
+ */
+ public static final String PROPERTY_BAN_LIST_CHANGED =
"BanListChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room user limit being changed.
+ */
+ public static final String PROPERTY_USER_LIMIT_CHANGED =
"UserLimitChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room state changed.
+ */
+ public static final String PROPERTY_STATE_CHANGED = "StateChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room password being changed.
+ */
+ public static final String PROPERTY_PASSWORD_CHANGED =
"PasswordChanged";
+
+ /**
+ * An optional String indicating a possible reason why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom source,
+ String
propertyName,
+ Object oldValue,
+ Object newValue,
+ String reason)
+ {
+ super(source, propertyName, oldValue, newValue);
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with this
+ * event.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns a reference to the protocol provider where the event has
+ * originated.
+ * <p>
+ * @return a reference to the ProtocolProviderService instance where
this
+ * event originated.
+ */
+ public ProtocolProviderService getProtocolProvider()
+ {
+ return getSourceChatRoom().getParentProvider();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
     {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + this.getPropertyName()
+ + " sourceRoom="
+ + this.getSource().toString()
+ + "oldValue="
+ + this.getOldValue().toString()
+ + "newValue="
+ + this.getNewValue().toString()
+ + "]";
     }

}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java
23 Apr 2007 18:11:22
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,124 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-import net.java.sip.communicator.service.protocol.*;
-
-/**
- * Dispatched to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomMemberEvent
- extends EventObject
-{
- /**
- * Indicates that this event was triggered as a result of the source
- * participant joining the source chat room.
- */
- public static final String MEMBER_JOINED = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant being "kicked" out of the chat room.
- */
- public static final String MEMBER_LEFT = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant leaving the source chat room.
- */
- public static final String MEMBER_KICKED = "MemberKicked";
-
- /**
- * The member that the event relates to.
- */
- private ChatRoomMember sourceMember = null;
-
- /**
- * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
- */
- private String eventType = null;
-
- /**
- * An optional String indicating a possible reason as to why the
event
- * might have occurred.
- */
- private String reason = null;
-
- public ChatRoomMemberEvent(ChatRoom sourceRoom,
- ChatRoomMember sourceMember,
- String eventType,
- String reason )
- {
- super(sourceRoom);
- this.sourceMember = sourceMember;
- this.eventType = eventType;
- this.reason = reason;
- }
-
- /**
- * Returns the source chat room for this event.
- *
- * @return the <tt>ChatRoom</tt> associated with that is the
source of this
- * event and that the corresponding ChatRoomMemberBelongs to.
- */
- public ChatRoom getChatRoom()
- {
- return (ChatRoom)getSource();
- }
-
- /**
- * Returns the member that this event is pertaining to.
- * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
- */
- public ChatRoomMember getChatRoomMember()
- {
- return sourceMember;
- }
-
- /**
- * A reason string indicating a human readable reason for this event.
- *
- * @return a human readable String containing the reason for this
event,
- * or null if no particular reason was specified.
- */
- public String getReason()
- {
- return reason;
- }
-
- /**
- * Returns the type of this event which could be one of the
MEMBER_XXX-ed
- * member field values.
- *
- * @return one of the MEMBER_XXXed member field values indicating
the type
- * of this event.
- */
- public String getEventType()
- {
- return eventType;
- }
-
- /**
- * Returns a String representation of this event.
- */
- public String toString()
- {
- return "ChatRoomMemberEvent[type="
- + getEventType()
- + " sourceRoom="
- + getChatRoom()
- + " member="
- + getChatRoomMember()
- + "]";
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java
22 Feb 2007 12:36:09
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in our status in the
room
- * such as us being kicked, banned, or granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomLocalUserStatusListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in our status in
the
- * source soom has changed. Changes may include us being kicked,
banned, or
- * granted admin permissions.
- */
- public void
localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt);
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java
23 Apr 2007 18:11:36
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java
21 May 2007 07:05:35
-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
  *
  * @author Emil Ivov
+ * @author Stéphane Remy
  */
public class ChatRoomMemberRoleChangeEvent
     extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMember sourceMember,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
     {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
     }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v
retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
---
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22
Feb
2007 12:35:34 -0000 1.1
+++
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 21
May
2007 07:05:34 -0000
@@ -7,13 +7,42 @@
package net.java.sip.communicator.service.protocol;

/**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a
chat room member
+ * to an other in order to invite this chat room member to join the
chat room this invitation
+ * have for target.
+ *
+ * @author Stéphane Remy
  */
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
{
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no
reason
+ *
+ * @return the reason of this invitation, or null if there is no
reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the
invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the
invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation
has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that
created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
}
Index:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
---
src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java
22
Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat
room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if
no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/ChatRoom.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoom.java,v
retrieving revision 1.4
diff -u -r1.4 ChatRoom.java
--- src/net/java/sip/communicator/service/protocol/ChatRoom.java 24
Apr 2007 12:31:25 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/ChatRoom.java 21
May 2007 07:05:34 -0000
@@ -17,7 +17,6 @@
  */
public interface ChatRoom
{
-
     /**
      * Returns the name of this <tt>ChatRoom</tt>.
      *
@@ -95,25 +94,6 @@
     public void leave();

     /**
- * Adds <tt>listener</tt> to the list of listeners registered to
receive
- * events upon modification of chat room properties such as its
subject
- * for example.
- *
- * @param listener ChatRoomChangeListener
- */
- public void addChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
- * Removes <tt>listener</tt> from the list of listeneres current
registered
- * for chat room modification events.
- *
- * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
- */
- public void removeChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
      * Returns the last known room subject/theme or <tt>null</tt> if the
user
      * hasn't joined the room or the room does not have a subject yet.
      * <p>
@@ -163,41 +143,88 @@
        throws OperationFailedException;

    /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
     *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
     */
- public void addLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void addLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

    /**
- * Removes a listener that was being notified of changes in our status
in
- * the room such as us being kicked, banned, or granted admin
permissions.
+ * Removes a listener that was being notified of changes in our
participation in
+ * the room such as us being kicked, join, left...
     *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
     */
- public void removeLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void removeLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

    /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left...
     *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
     */
- public void addMemberListener(ChatRoomMemberListener listener);
+ public void
addMemberParticipationListener(ChatRoomMemberParticipationListener
listener);

    /**
- * Removes a listener that was being notified of changes in the status
of
- * other chat room participants such as users being kicked, banned, or
- * granted admin permissions.
+ * Removes a listener that was being notified of changes in the
participation of
+ * other chat room participants such as users being kicked, join,
left.
     *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
     */
- public void removeMemberListener(
- ChatRoomMemberListener listener);
-
+ public void
removeMemberParticipationListener(ChatRoomMemberParticipationListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in our role
in the room
+ * such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in our role
in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes of a member
role in the room
+ * such as being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void addMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Removes a listener that was being notified of changes of a
member role in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void removeMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in the
property of the room
+ * such as the subject being change or the room state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
addPropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in the
property of
+ * the chat room such as the subject being change or the room
state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
removePropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
     /**
      * Invites another user to this room.
      * <p>
@@ -285,6 +312,82 @@
      */
     public ProtocolProviderService getParentProvider();

- //include - roominfo
- /** @todo include room info */
+ /**
+ * Sets the password of this chat room. If the user does not have
the right
+ * to change the room password, or the protocol does not support
this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param password the new password that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setPassword(final String password)
+ throws OperationFailedException;
+
+ /**
+ * Adds a ban mask to the list fo ban masks of this chat room. If
the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the new ban mask that we'd like to add to this
room ban list
+ * @throws OperationFailedException
+ */
+ public void addBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Remove a ban mask of the list fo ban masks of this chat room.
If the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the ban mask that we'd like to remove from this
room ban list
+ * @throws OperationFailedException
+ */
+ public void removeBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Sets the user limit of this chat room. If the user does not
have the right
+ * to change the room user limit, or the protocol does not
support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param userLimit the new user limit that we'd like this room to
have
+ * @throws OperationFailedException
+ */
+ public void setUserLimit(final int userLimit)
+ throws OperationFailedException;
+
+ /**
+ * Sets a state of this chat room. If the user does not have the
right
+ * to change the room state, or the protocol does not support this,
or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param state the new state that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setState(ChatRoomState state)
+ throws OperationFailedException;
+
+ /**
+ * Returns the list of ban mask that are currently of this chat room.
+ * @return List the ban list of this room.
+ */
+ public List getBanList();
+
+ /**
+ * Returns the list of states that this chat room is currently in.
+ * @return List the list of states of this chat room.
+ */
+ public List getStateList();
+
+ /**
+ * Returns the limit of user of this chat room, of returns -1 if
there is
+ * no limit.
+ * @return List the list of states of this chat room.
+ */
+ public int getUserLimit();
}
Index:

src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v
retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
---
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java
23 Apr 2007 18:12:44
-0000 1.4
+++
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java
21 May 2007 07:05:35
-0000
@@ -45,11 +45,11 @@
     public List getCurrentlyJoinedChatRooms();

     /**
- * Returns a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
      * currently active in.
      *
- * @param contact the contact whose current ChatRooms we will be
querying.
- * @return a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * @param chatRoomMember the chatRoomMember whose current
ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
      * currently active in.
      *
      * @throws OperationFailedException if an error occurs while trying
to
@@ -57,7 +57,7 @@
      * @throws OperationNotSupportedException if the server does not
support
      * multi user chat
      */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember
chatRoomMember)
         throws OperationFailedException, OperationNotSupportedException;

     /**
@@ -110,7 +110,7 @@
      *
      * @param listener an invitation listener.
      */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener
listener);

     /**
      * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
      *
      * @param listener the invitation listener to remove.
      */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener
listener);

     /**
      * Adds a listener to invitation notifications. The listener
will be fired
@@ -127,7 +127,7 @@
      * @param listener an invitation listener.
      */
     public void addInvitationRejectionListener(
- InvitationRejectionListener
listener);
+
ChatRoomInvitationRejectionListener listener);

     /**
      * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,14 +136,5 @@
      * @param listener the invitation listener to remove.
      */
     public void removeInvitationRejectionListener(
- InvitationRejectionListener
listener);
-
- /**
- * Returns true if <tt>contact</tt> supports multi user chat
sessions.
- *
- * @param contact reference to the contact whose support for chat
rooms
- * we are currently querying.
- * @return a boolean indicating whether <tt>contact</tt> supports
chatrooms.
- */
- public boolean isMultiChatSupportedByContact(Contact contact);
+
ChatRoomInvitationRejectionListener listener);
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,25 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomLocalUserParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in our
participation in the
+ * source soom has occured. Changes may include us being kicked,
join, left.
+ */
+ public void
localUserParticipationChanged(ChatRoomLocalUserParticipationChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room
is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that
contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void
invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,28 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomLocalUserRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,112 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.EventObject;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our
paticipation in the
+ * source room has occured. Changes may include us being kicked,
join, left...
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserParticipationChangeEvent(ChatRoom sourceRoom,
+
String eventType,
+
String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,131 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in the
participation of the
+ * source room participant has changed. Changes may include the
participant
+ * being kicked, join, left...
+ *
+ * @author Emil Ivov
+ */
+public class ChatRoomMemberParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomMemberParticipationChangeEvent(ChatRoom
sourceRoom,
+ ChatRoomMember sourceMember,
+ String eventType,
+ String reason )
+ {
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getChatRoomMember()
+ {
+ return sourceMember;
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomMemberEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom().toString()
+ + " member="
+ + getChatRoomMember().toString()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which
was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by
us.
+ *
+ * @param evt the instance of the
<tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the
participation of the chat
+ * member in a particular chat room, such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomMemberParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the
participation of the
+ * source room member has changed. Changes may include the
participant
+ * being kicked, join, left.
+ */
+ public void
memberParticipationChanged(ChatRoomMemberParticipationChangeEvent evt );
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a
rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is
no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt>
representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,77 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserRoleChangeEvent
+ extends EventObject
+{
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
+ {
+ super(sourceRoom);
+ this.previousRole = previousRole;
+ this.newRole = newRole;
+ }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java
1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing
reception of the
+ * <tt>source</tt> invitation received from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/ChatRoomState.java

RCS file:
src/net/java/sip/communicator/service/protocol/ChatRoomState.java
diff -N src/net/java/sip/communicator/service/protocol/ChatRoomState.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/ChatRoomState.java 1
Jan 1970 00:00:00 -0000
@@ -0,0 +1,589 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+/**
+ * The ChatRoomState class reflects the current state of a chat room.
+ *
+ * @author Stéphane Remy
+ */
+public class ChatRoomState
+{
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_VISIBLE state.
+ * <p>
+ * This constant has the String value "Visible".
+ */
+ public static final String _CHATROOM_VISIBLE = "Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_VISIBLE = new
ChatRoomState(_CHATROOM_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Not Visible".
+ */
+ public static final String _CHATROOM_NOT_VISIBLE = "Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_VISIBLE = new
ChatRoomState(_CHATROOM_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Required".
+ */
+ public static final String _CHATROOM_PASSWORD_REQUIRED = "Password
Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_REQUIRED = new
ChatRoomState(_CHATROOM_PASSWORD_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Not Required".
+ */
+ public static final String _CHATROOM_PASSWORD_NOT_REQUIRED =
"Password Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_NOT_REQUIRED =
new ChatRoomState(_CHATROOM_PASSWORD_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Required".
+ */
+ public static final String _CHATROOM_INVITATION_REQUIRED =
"Invitation Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUIRED =
new
ChatRoomState(_CHATROOM_INVITATION_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Not Required".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_REQUIRED =
"Invitation Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_REQUIRED

new ChatRoomState(_CHATROOM_INVITATION_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_LIMITED = "User
Number Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_LIMITED =
new
ChatRoomState(_CHATROOM_USER_NUMBER_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Not Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_NOT_LIMITED =
"User
Number Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_NOT_LIMITED

new ChatRoomState(_CHATROOM_USER_NUMBER_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MUTE state.
+ * <p>
+ * This constant has the String value "Mute".
+ */
+ public static final String _CHATROOM_MUTE = "Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * mute state no messages are get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_MUTE = new
ChatRoomState(_CHATROOM_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_MUTE state.
+ * <p>
+ * This constant has the String value "Not Mute".
+ */
+ public static final String _CHATROOM_NOT_MUTE = "Not Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * mute state messages can be get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_NOT_MUTE = new
ChatRoomState(_CHATROOM_NOT_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_ALLOWED =
"External Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * external messages allowed state, this chat room can receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Not
Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED

"External Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * external messages allowed state, this chat room can not receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_REGISTERED state.
+ * <p>
+ * This constant has the String value "Registered".
+ */
+ public static final String _CHATROOM_REGISTERED = "Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_REGISTERED = new
ChatRoomState(_CHATROOM_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Not Registered".
+ */
+ public static final String _CHATROOM_NOT_REGISTERED = "Not
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_REGISTERED = new
ChatRoomState(_CHATROOM_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Locked".
+ */
+ public static final String _CHATROOM_SUBJECT_LOCKED = "Subject
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * subject locked state, only admin users can change the subject
of
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_LOCKED = new
ChatRoomState(_CHATROOM_SUBJECT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Not locked".
+ */
+ public static final String _CHATROOM_SUBJECT_NOT_LOCKED = "Subject
Not locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * subject locked state, all users can change the subject of this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_NOT_LOCKED =
new
ChatRoomState(_CHATROOM_SUBJECT_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_ALLOWED =
"Message Format Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format allowed, all colored, underlined... messages are
allowed.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_ALLOWED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Not Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED =
"Message Format Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format not allowed, all colored, underlined... messages
are not allowed.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_FILTERED =
"Message Format Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format filtered state, all colored, underlined...
messages are seen in standard format
+ * by other users.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_FILTERED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Not Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_FILTERED =
"Message Format Not Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * message format filtered state, all colored, underlined...
messages are seen
+ * by other users.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_LIMITED = "Join
Time
Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * join time limited state, users can only join in an interval of
X time.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_LIMITED = new
ChatRoomState(_CHATROOM_JOIN_TIME_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Not Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_NOT_LIMITED = "Join
Time Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * join time limited state.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_NOT_LIMITED =
new ChatRoomState(_CHATROOM_JOIN_TIME_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_REQUEST_ALLOWED =
"Invitation Request Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation request allowed state, all invitation request are
allowed.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Not
Allowed".
+ */
+ public static final String
_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED
= "Invitation Request Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation request allowed state, all invitation request are
rejected.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Redirected".
+ */
+ public static final String _CHATROOM_USER_REDIRECTED = "User
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * user redirected state, all users which join this chat room are
redirected to an other one.
+ */
+ public static final ChatRoomState CHATROOM_USER_REDIRECTED = new
ChatRoomState(_CHATROOM_USER_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NOT_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Not Redirected".
+ */
+ public static final String _CHATROOM_USER_NOT_REDIRECTED = "User
Not
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * user redirected state, all users which join this chat room are
not redirected.
+ */
+ public static final ChatRoomState CHATROOM_USER_NOT_REDIRECTED =
new
ChatRoomState(_CHATROOM_USER_NOT_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_LOCKED = "Nicknames
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nicknames locked state, users in this chat room can not change
their nickname.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_LOCKED = new
ChatRoomState(_CHATROOM_NICKNAMES_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Not Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_NOT_LOCKED =
"Nicknames Not Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nicknames locked state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_NOT_LOCKED =
new ChatRoomState(_CHATROOM_NICKNAMES_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Locked".
+ */
+ public static final String _CHATROOM_KICK_LOCKED = "Kick Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * kick locked state, kicks are locked on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_KICK_LOCKED = new
ChatRoomState(_CHATROOM_KICK_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Not Locked".
+ */
+ public static final String _CHATROOM_KICK_NOT_LOCKED = "Kick Not
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * kick locked state.
+ */
+ public static final ChatRoomState CHATROOM_KICK_NOT_LOCKED = new
ChatRoomState(_CHATROOM_KICK_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Registered".
+ */
+ public static final String _CHATROOM_USERS_REGISTERED = "Users
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * users registered state, only registered users can join this
room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_REGISTERED = new
ChatRoomState(_CHATROOM_USERS_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Not Registered".
+ */
+ public static final String _CHATROOM_USERS_NOT_REGISTERED = "Users
Not Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * users registered state, all users can join this chat room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_NOT_REGISTERED =
new ChatRoomState(_CHATROOM_USERS_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_ALLOWED =
"Special Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * special messages allowed state.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Not Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED

"Special Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * special messages allowed state, only a specific level type of
message are allowed.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_VISIBLE =
"Nickname List Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAME_LIST_VISIBLE =
new ChatRoomState(_CHATROOM_NICKNAME_LIST_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Not Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_NOT_VISIBLE =
"Nickname List Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState
CHATROOM_NICKNAME_LIST_NOT_VISIBLE
= new ChatRoomState(_CHATROOM_NICKNAME_LIST_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_ALLOWED =
"Invitation Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * invitation allowed state, users can invite other users in this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_ALLOWED =
new
ChatRoomState(_CHATROOM_INVITATION_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Not Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_ALLOWED =
"Invitation Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * invitation allowed state, users can not invite other users in
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_ALLOWED

new ChatRoomState(_CHATROOM_INVITATION_NOT_ALLOWED);
+
+ /**
+ * A string representation of this Chat Room State.
+ */
+ private String chatRoomStateStr;
+
+ /**
+ * Create a chat room state object with a value corresponding to
the specified
+ * string.
+ * @param chatRoomState a string representation of the state.
+ */
+ private ChatRoomState(String chatRoomState)
+ {
+ this.chatRoomStateStr = chatRoomState;
+ }
+
+ /**
+ * Returns a String representation of that chat room State.
+ *
+ * @return a string value (one of the _CHATROOM_XXX constants)
representing
+ * this chat room state).
+ */
+ public String getStateString()
+ {
+ return chatRoomStateStr;
+ }
+
+ /**
+ * Returns a string represenation of this call state. Strings
returned
+ * by this method have the following format:
+ * "ChatRoomState:<STATE_STRING>" and are meant to be used for
loggin/debugging
+ * purposes.
+ * @return a string representation of this object.
+ */
+ public String toString()
+ {
+ return getClass().getName()+":"+getStateString();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java
diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

Stéphane Remy wrote:

Hello,

Emil, Yana

I've changed some of the services and events, related to the chat
rooms, all i've changed isn't already implemented for irc but i
want you to take a look and tell me if you are ok with what i've
done and maybe add it to sc :).

And if someone else has an idee about changes, additions to do
about multi user chat you are welcome on this thread :wink:

Stéphane

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java
diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java
---
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22
Feb 2007 12:37:47 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationRejectedEvent
- extends EventObject
-{
- public InvitationRejectedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v
retrieving revision

1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22
Feb 2007 12:37:18 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -7,6 +7,7 @@
package net.java.sip.communicator.service.protocol.event;

import java.util.*;
+import net.java.sip.communicator.service.protocol.*;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property

of

@@ -14,14 +15,159 @@
* The event contains references to the source chat room and
provider, the name
* of the property that has just changed as well as its old and new

values.

*
- * @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomPropertyChangeEvent
    extends EventObject
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room topic being changed, that means the subject of
this channel
+ * has changed
+ */
+ public static final String TOPIC_CHANGED = "TopicChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode private, that means the channel
is now no more
+ * visible in the list of channels
+ */
+ public static final String MODE_PRIVATE = "ModePrivate";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode secret, that means the channel
is now no more
+ * visible in the list of channels and no one can make a
request on this channel
+ * in order to see if it exists like in irc a whois on a
channel if it is in mode
+ * secret don't response.
+ */
+ public static final String MODE_SECRET = "ModeSecret";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode invite only, that means the
channel can only
+ * be joined by invited members.
+ */
+ public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode topic protected, that means the
channel topic can only
+ * be changed by operators.
+ */
+ public static final String MODE_TOPIC_PROTECTED =

"ModeTopicProtected";

+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode chat room message only, that
means the channel can only receive
+ * messages from a user that is on this channel.
+ */
+ public static final String MODE_CHAT_ROOM_MESSAGE_ONLY =
"ModeChatRoomMessageOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode moderated, that means only user
that have
+ * enough level in this room can send messages.
+ */
+ public static final String MODE_MODERATED = "ModeModerated";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode max user, that means only a max
number of
+ * members can join this chat room.
+ */
+ public static final String MODE_MAX_USER = "ModeMaxUser";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode key, that means that all members

need

+ * a key to join this channel.
+ */
+ public static final String MODE_KEY = "ModeKey";
+
+ /**
+ * The type of this event. Values can be any of the above fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible content of the event
+ * that have occurred, like if a key is set, or a max user

number...

+ */
+ private String content = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String content,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.content = content;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the above
+ * field values.
+ *
+ * @return one of the field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * A reason string indicating the content of this event.
+ *
+ * @return a human readable String containing the content for
this event,
+ * or null if no particular content was specified.
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
    {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
    }

}
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
---
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java
22 Feb 2007 12:37:33 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * A listener that is fired anytime an invitation to join a MUC
room is received.
- *
- * @author Emil Ivov
- */
-public interface InvitationListener
-{
- /**
- * Called when we receive an invitation to join an existing

ChatRoom.

- * <p>
- * @param evt the <tt>InvitationReceivedEvent</tt> that
contains the newly
- * received invitation and its source provider.
- */
- public abstract void invitationReceived(InvitationReceivedEvent

evt);

-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v
retrieving revision

1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23
Apr 2007 18:11:36 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role

in the

+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
    extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole

previousRole,

+ ChatRoomMemberRole newRole)
    {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
    }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is
pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v
retrieving revision

1.1
diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -6,18 +6,109 @@
*/
package net.java.sip.communicator.service.protocol.event;

+import java.util.EventObject;
+
+import net.java.sip.communicator.service.protocol.*;
+
/**
* Dispatched to notify interested parties that a change in our
status in the
* source room has changed. Changes may include us being kicked,

banned, or

* granted admin permissions.
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomLocalUserStatusChangeEvent
+ extends EventObject
{
- public ChatRoomLocalUserStatusChangeEvent()
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the
MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
    {
- super();
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
    }

+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values
indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/event...

[Message clipped]

--
Vous êtes unique, comme tout le monde!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#6

Hi Stephane,

thanks for the remarks! I've just applied your fixes and committed them to the CVS.

Yana

StÔŅĹphane Remy wrote:

···

Hi Yana,

Sorry for the late answer. I updated my code with your changes and i'm ok with all you've done. I just noticed two things you forgot to change:

In ChatRoomPropertyChangeEvent:

You forgot to change PROPERTY_STATE_CHANGED into PROPERTY_CONFIG_CHANGED.

In ChatRoomConfigParam:

You forgot to remove _CHAT_ROOM_NOT_VISIBLE.

StÔŅĹphane

Yana Stamcheva <yana@sip-communicator.org> a ÔŅĹcrit :

Hi Stephane,

very well structured and complete code! You've done a very good work!

I have just committed your code to the cvs. I had to make some minor
modifications so the code fit better to SIP Communicator conventions, you
could see the list of changes below.

General modifications

- Removed special characters from author name - StÔŅĹphane was renamed to
Stephane

- Added additional comments where needed

- Renamed
- ChatRoomLocalUserParticipationChangeEvent to
ChatRoomLocalUserPresenceChangeEvent
- ChatRoomLocalUserParticipationListener to
ChatRoomLocalUserPresenceListener -
- ChatRoomMemberParticipationChangeEvent to
ChatRoomMemberPresenceChangeEvent
- ChatRoomMemberParticipationListener to ChatRoomMemberPresenceListener

After a discussion with Emil we decided to take the "Presence" name, it
appears more intuitive

ChatRoom

- Added some additional comments to setUserLimit, addBanMask, removeBanMask,
getBanList, getUserLimit - to explain some more details on what ban mask or
ban list is, what is the user limit about, etc.

- Renamed setState to addConfigParam - we renamed also the ChatRoomState
class to ChatRoomConfigParam. I had a look in the ChatRoomState class and I
would say that properties there are rather configuration patameters and not
chat room states.

- Added removeConfigParam, getSupportedConfigurationParams and
getConfiguration - in order to be able to remove a configuration parameter,
to obtain the list of configuration paramaters supported by the current
implementation and to obtain the current chat room configuration.

- Added getPassword method - it was only a setPassword.

- Removed final modifiers for String and int parameters - Java API says that
"Strings are constant; their values cannot be changed after they are
created" . And ints are not objects and they're copied by value (i.e. a
brand new copy is created and is passed to the method), so the final
modifier is redundant in this case.

ChatRoomState

- Renamed to ChatRoomConfigParam - as I already mentioned the name wasn't
very well fitting the content of the class, so we tried to make it more
intuitive

- Formatted the code - lines were longer than 80 columns

- Added additional comments

- Removed CHAT_ROOM_PASSWORD_NOT_REQUIRED, CHATROOM_INVITATION_NOT_REQUIRED,
CHATROOM_USER_NUMBER_NOT_LIMITED, CHATROOM_NOT_MUTE,
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED, CHATROOM_NOT_REGISTERED,
CHATROOM_SUBJECT_NOT_LOCKED, CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED,
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED, CHATROOM_JOIN_TIME_NOT_LIMITED, etc.

- Renamed CHAT_ROOM_USER_REGISTERED to CHAT_ROOM_ONLY_REGISTERED_USER - I
think it's more intuitive this way

- All _XXX String constants are changed to protected - they will be used
only internaly and may be by descendants

ChatRoomInvitation

- get back the name of the author of the class - should not remove the name
of the author even if the class was almost empty and we wrote the whole
implementation:)

ChatRoomPropertyChangeEvent

- get back the name of the author of the class:)

- Removed the getProtocolProvider method - the protocol provider could be
obtained from the chat room and has nothing to do in the context of this
event

- Removed the reason field - I don't think we need to have the String
reason, I don't really see for what it could be used.

- Added getOldValue and getNewValue methods - in order to be able to obtain
previous and new property values

That's all for now.

Thanks again Stephane and Loic for the great work! I'll continue with the
irc implementation now and soon we'll have all your work on cvs.

If you have any remarks on above changes you're welcome to express yourself.

Regards,
Yana

On 5/21/07, StÔŅĹphane Remy <stephane.remy@ulp.u-strasbg.fr> wrote:

Hi Yana,

I have made a lot of changes again to this services, i hope i didn't
forget something, otherwise don't hesitate to tell it to me i will
fixe it.

Quoting Yana Stamcheva <yana@sip-communicator.org>:

Hi Stephane,

Sorry for the late response. You have done really good work here. Bravo!

I would propose just some minor changes to discuss:
- In ChatRoomMemberRoleListener we should called the method
memberRoleChanged, instead of memberStatusChanged. (I think it's a copy
paste error)

I have changed that.

- In ChatRoomInvitatioXXXEvent we should rename the method
getSourceMessage to getSourceInvitation or getChatRoomInvitation,
because actually it returns a ChatRoomInvitation.

It's fixed too.

- After a discussion with Emil we think that it would be correct that
ChatRoomPropertyChangeEvent extends java.beans.PropertyChangeEvent and
thus it should implement getOldValue and getNewValue methods.

For this part i have made a lot of changes, i have used the
java.beans.PropertyChangeEvent, but i have also created a class name
ChatRoomState which contains all the possible states for a chat room.

- We have some doubts for the name TOPIC_CHANGED. In the ChatRoom we
already have a property called "subject", so may be it's better to call
it SUBJECT_CHANGED here also.

It's fixed too.

- In fact all the names of properties in the
ChatRoomPropertyChangeEvent are not very well matching the convention
used for property names. We should change them may be by replacing MODE
with PROPERTY and further more by adjusting better the names so that
they are more intuitive.

I have made them as intuitive as possible this time, but if you find
better words to make them more intuitive just tell me.

- And finally all properties defined in the ChatRoomPropertyChangeEvent
should also exist as properties in the ChatRoom, because they are
actually properties of the chat room and we should be able to get and
set their value from there.

I have changed this too.

That's all for now. May be Emil will have something to add.

I should say one more time congratulations for the work :slight_smile:

Yana

Fot the ChatRoomState class i'm not sure if it is the best way to do,
so tell me what do you think about it.

StÔŅĹphane

here is the patch:

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * Dispatched to notify interested parties that a change in our status in
the
- * source room has changed. Changes may include us being kicked, banned,
or
- * granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomLocalUserStatusChangeEvent
-{
- public ChatRoomLocalUserStatusChangeEvent()
- {
- super();
- }
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java

---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java 23
Apr 2007 18:11:29
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in the status of the
chat
- * participants in a particular chat room, such as us being kicked,
banned, or
- * granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomMemberListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- */
- public void memberStatusChanged( ChatRoomMemberEvent evt );
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v

retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

22 Feb 2007 12:37:18
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

21 May 2007 07:05:35
-0000
@@ -6,22 +6,114 @@
  */
package net.java.sip.communicator.service.protocol.event;

-import java.util.*;
+import net.java.sip.communicator.service.protocol.ChatRoom;
+import net.java.sip.communicator.service.protocol.ProtocolProviderService
;

/**
  * <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property
of
- * the corresponding chat room (e.g. its subject or type) have been
modified.
+ * the corresponding chat room (e.g. its subject or state) have been
modified.
  * The event contains references to the source chat room and
provider, the name
  * of the property that has just changed as well as its old and new
values.
  *
- * @author Emil Ivov
+ * @author StÔŅĹphane Remy
  */
public class ChatRoomPropertyChangeEvent
- extends EventObject
+ extends java.beans.PropertyChangeEvent
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room subject being changed.
+ */
+ public static final String PROPERTY_SUBJECT_CHANGED =
"SubjectChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room ban list being changed.
+ */
+ public static final String PROPERTY_BAN_LIST_CHANGED =
"BanListChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room user limit being changed.
+ */
+ public static final String PROPERTY_USER_LIMIT_CHANGED =
"UserLimitChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room state changed.
+ */
+ public static final String PROPERTY_STATE_CHANGED = "StateChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room password being changed.
+ */
+ public static final String PROPERTY_PASSWORD_CHANGED =
"PasswordChanged";
+
+ /**
+ * An optional String indicating a possible reason why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom source,
+ String
propertyName,
+ Object oldValue,
+ Object newValue,
+ String reason)
+ {
+ super(source, propertyName, oldValue, newValue);
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with this
+ * event.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns a reference to the protocol provider where the event has
+ * originated.
+ * <p>
+ * @return a reference to the ProtocolProviderService instance where
this
+ * event originated.
+ */
+ public ProtocolProviderService getProtocolProvider()
+ {
+ return getSourceChatRoom().getParentProvider();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
     {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + this.getPropertyName()
+ + " sourceRoom="
+ + this.getSource().toString()
+ + "oldValue="
+ + this.getOldValue().toString()
+ + "newValue="
+ + this.getNewValue().toString()
+ + "]";
     }

}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java

23 Apr 2007 18:11:22
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,124 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-import net.java.sip.communicator.service.protocol.*;
-
-/**
- * Dispatched to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomMemberEvent
- extends EventObject
-{
- /**
- * Indicates that this event was triggered as a result of the source
- * participant joining the source chat room.
- */
- public static final String MEMBER_JOINED = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant being "kicked" out of the chat room.
- */
- public static final String MEMBER_LEFT = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant leaving the source chat room.
- */
- public static final String MEMBER_KICKED = "MemberKicked";
-
- /**
- * The member that the event relates to.
- */
- private ChatRoomMember sourceMember = null;
-
- /**
- * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
- */
- private String eventType = null;
-
- /**
- * An optional String indicating a possible reason as to why the
event
- * might have occurred.
- */
- private String reason = null;
-
- public ChatRoomMemberEvent(ChatRoom sourceRoom,
- ChatRoomMember sourceMember,
- String eventType,
- String reason )
- {
- super(sourceRoom);
- this.sourceMember = sourceMember;
- this.eventType = eventType;
- this.reason = reason;
- }
-
- /**
- * Returns the source chat room for this event.
- *
- * @return the <tt>ChatRoom</tt> associated with that is the
source of this
- * event and that the corresponding ChatRoomMemberBelongs to.
- */
- public ChatRoom getChatRoom()
- {
- return (ChatRoom)getSource();
- }
-
- /**
- * Returns the member that this event is pertaining to.
- * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
- */
- public ChatRoomMember getChatRoomMember()
- {
- return sourceMember;
- }
-
- /**
- * A reason string indicating a human readable reason for this event.
- *
- * @return a human readable String containing the reason for this
event,
- * or null if no particular reason was specified.
- */
- public String getReason()
- {
- return reason;
- }
-
- /**
- * Returns the type of this event which could be one of the
MEMBER_XXX-ed
- * member field values.
- *
- * @return one of the MEMBER_XXXed member field values indicating
the type
- * of this event.
- */
- public String getEventType()
- {
- return eventType;
- }
-
- /**
- * Returns a String representation of this event.
- */
- public String toString()
- {
- return "ChatRoomMemberEvent[type="
- + getEventType()
- + " sourceRoom="
- + getChatRoom()
- + " member="
- + getChatRoomMember()
- + "]";
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java

---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java

22 Feb 2007 12:36:09
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in our status in the
room
- * such as us being kicked, banned, or granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomLocalUserStatusListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in our status in
the
- * source soom has changed. Changes may include us being kicked,
banned, or
- * granted admin permissions.
- */
- public void
localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt);
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v

retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

23 Apr 2007 18:11:36
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

21 May 2007 07:05:35
-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
  *
  * @author Emil Ivov
+ * @author StÔŅĹphane Remy
  */
public class ChatRoomMemberRoleChangeEvent
     extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMember sourceMember,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
     {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
     }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v

retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
---
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22
Feb
2007 12:35:34 -0000 1.1
+++
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 21
May
2007 07:05:34 -0000
@@ -7,13 +7,42 @@
package net.java.sip.communicator.service.protocol;

/**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a
chat room member
+ * to an other in order to invite this chat room member to join the
chat room this invitation
+ * have for target.
+ *
+ * @author StÔŅĹphane Remy
  */
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
{
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no
reason
+ *
+ * @return the reason of this invitation, or null if there is no
reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the
invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the
invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation
has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that
created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
}
Index:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

diff -N

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

---
src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java

22
Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat
room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if
no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/ChatRoom.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoom.java,v

retrieving revision 1.4
diff -u -r1.4 ChatRoom.java
--- src/net/java/sip/communicator/service/protocol/ChatRoom.java 24
Apr 2007 12:31:25 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/ChatRoom.java 21
May 2007 07:05:34 -0000
@@ -17,7 +17,6 @@
  */
public interface ChatRoom
{
-
     /**
      * Returns the name of this <tt>ChatRoom</tt>.
      *
@@ -95,25 +94,6 @@
     public void leave();

     /**
- * Adds <tt>listener</tt> to the list of listeners registered to
receive
- * events upon modification of chat room properties such as its
subject
- * for example.
- *
- * @param listener ChatRoomChangeListener
- */
- public void addChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
- * Removes <tt>listener</tt> from the list of listeneres current
registered
- * for chat room modification events.
- *
- * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
- */
- public void removeChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
      * Returns the last known room subject/theme or <tt>null</tt> if the
user
      * hasn't joined the room or the room does not have a subject yet.
      * <p>
@@ -163,41 +143,88 @@
        throws OperationFailedException;

    /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
     *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
     */
- public void addLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void addLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

    /**
- * Removes a listener that was being notified of changes in our status
in
- * the room such as us being kicked, banned, or granted admin
permissions.
+ * Removes a listener that was being notified of changes in our
participation in
+ * the room such as us being kicked, join, left...
     *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
     */
- public void removeLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void removeLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

    /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left...
     *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
     */
- public void addMemberListener(ChatRoomMemberListener listener);
+ public void
addMemberParticipationListener(ChatRoomMemberParticipationListener
listener);

    /**
- * Removes a listener that was being notified of changes in the status
of
- * other chat room participants such as users being kicked, banned, or
- * granted admin permissions.
+ * Removes a listener that was being notified of changes in the
participation of
+ * other chat room participants such as users being kicked, join,
left.
     *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
     */
- public void removeMemberListener(
- ChatRoomMemberListener listener);
-
+ public void
removeMemberParticipationListener(ChatRoomMemberParticipationListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in our role
in the room
+ * such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in our role
in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes of a member
role in the room
+ * such as being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void addMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Removes a listener that was being notified of changes of a
member role in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void removeMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in the
property of the room
+ * such as the subject being change or the room state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
addPropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in the
property of
+ * the chat room such as the subject being change or the room
state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
removePropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
     /**
      * Invites another user to this room.
      * <p>
@@ -285,6 +312,82 @@
      */
     public ProtocolProviderService getParentProvider();

- //include - roominfo
- /** @todo include room info */
+ /**
+ * Sets the password of this chat room. If the user does not have
the right
+ * to change the room password, or the protocol does not support
this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param password the new password that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setPassword(final String password)
+ throws OperationFailedException;
+
+ /**
+ * Adds a ban mask to the list fo ban masks of this chat room. If
the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the new ban mask that we'd like to add to this
room ban list
+ * @throws OperationFailedException
+ */
+ public void addBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Remove a ban mask of the list fo ban masks of this chat room.
If the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the ban mask that we'd like to remove from this
room ban list
+ * @throws OperationFailedException
+ */
+ public void removeBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Sets the user limit of this chat room. If the user does not
have the right
+ * to change the room user limit, or the protocol does not
support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param userLimit the new user limit that we'd like this room to
have
+ * @throws OperationFailedException
+ */
+ public void setUserLimit(final int userLimit)
+ throws OperationFailedException;
+
+ /**
+ * Sets a state of this chat room. If the user does not have the
right
+ * to change the room state, or the protocol does not support this,
or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param state the new state that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setState(ChatRoomState state)
+ throws OperationFailedException;
+
+ /**
+ * Returns the list of ban mask that are currently of this chat room.
+ * @return List the ban list of this room.
+ */
+ public List getBanList();
+
+ /**
+ * Returns the list of states that this chat room is currently in.
+ * @return List the list of states of this chat room.
+ */
+ public List getStateList();
+
+ /**
+ * Returns the limit of user of this chat room, of returns -1 if
there is
+ * no limit.
+ * @return List the list of states of this chat room.
+ */
+ public int getUserLimit();
}
Index:

src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v

retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
---
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java

23 Apr 2007 18:12:44
-0000 1.4
+++
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java

21 May 2007 07:05:35
-0000
@@ -45,11 +45,11 @@
     public List getCurrentlyJoinedChatRooms();

     /**
- * Returns a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
      * currently active in.
      *
- * @param contact the contact whose current ChatRooms we will be
querying.
- * @return a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * @param chatRoomMember the chatRoomMember whose current
ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
      * currently active in.
      *
      * @throws OperationFailedException if an error occurs while trying
to
@@ -57,7 +57,7 @@
      * @throws OperationNotSupportedException if the server does not
support
      * multi user chat
      */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember
chatRoomMember)
         throws OperationFailedException, OperationNotSupportedException;

     /**
@@ -110,7 +110,7 @@
      *
      * @param listener an invitation listener.
      */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener
listener);

     /**
      * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
      *
      * @param listener the invitation listener to remove.
      */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener
listener);

     /**
      * Adds a listener to invitation notifications. The listener
will be fired
@@ -127,7 +127,7 @@
      * @param listener an invitation listener.
      */
     public void addInvitationRejectionListener(
- InvitationRejectionListener
listener);
+
ChatRoomInvitationRejectionListener listener);

     /**
      * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,14 +136,5 @@
      * @param listener the invitation listener to remove.
      */
     public void removeInvitationRejectionListener(
- InvitationRejectionListener
listener);
-
- /**
- * Returns true if <tt>contact</tt> supports multi user chat
sessions.
- *
- * @param contact reference to the contact whose support for chat
rooms
- * we are currently querying.
- * @return a boolean indicating whether <tt>contact</tt> supports
chatrooms.
- */
- public boolean isMultiChatSupportedByContact(Contact contact);
+
ChatRoomInvitationRejectionListener listener);
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,25 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomLocalUserParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in our
participation in the
+ * source soom has occured. Changes may include us being kicked,
join, left.
+ */
+ public void
localUserParticipationChanged(ChatRoomLocalUserParticipationChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room
is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that
contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void
invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java

1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,28 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy StÔŅĹphane
+ */
+public interface ChatRoomLocalUserRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java

1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,112 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.EventObject;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our
paticipation in the
+ * source room has occured. Changes may include us being kicked,
join, left...
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomLocalUserParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserParticipationChangeEvent(ChatRoom sourceRoom,
+
String eventType,
+
String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,131 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in the
participation of the
+ * source room participant has changed. Changes may include the
participant
+ * being kicked, join, left...
+ *
+ * @author Emil Ivov
+ */
+public class ChatRoomMemberParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomMemberParticipationChangeEvent(ChatRoom
sourceRoom,
+ ChatRoomMember sourceMember,
+ String eventType,
+ String reason )
+ {
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getChatRoomMember()
+ {
+ return sourceMember;
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomMemberEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom().toString()
+ + " member="
+ + getChatRoomMember().toString()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java

1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which
was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by
us.
+ *
+ * @param evt the instance of the
<tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java

1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the
participation of the chat
+ * member in a particular chat room, such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomMemberParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the
participation of the
+ * source room member has changed. Changes may include the
participant
+ * being kicked, join, left.
+ */
+ public void
memberParticipationChanged(ChatRoomMemberParticipationChangeEvent evt );
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java

1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a
rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is
no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt>
representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,77 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomLocalUserRoleChangeEvent
+ extends EventObject
+{
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
+ {
+ super(sourceRoom);
+ this.previousRole = previousRole;
+ this.newRole = newRole;
+ }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java

1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing
reception of the
+ * <tt>source</tt> invitation received from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/ChatRoomState.java

RCS file:
src/net/java/sip/communicator/service/protocol/ChatRoomState.java
diff -N src/net/java/sip/communicator/service/protocol/ChatRoomState.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/ChatRoomState.java 1
Jan 1970 00:00:00 -0000
@@ -0,0 +1,589 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+/**
+ * The ChatRoomState class reflects the current state of a chat room.
+ *
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomState
+{
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_VISIBLE state.
+ * <p>
+ * This constant has the String value "Visible".
+ */
+ public static final String _CHATROOM_VISIBLE = "Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_VISIBLE = new
ChatRoomState(_CHATROOM_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Not Visible".
+ */
+ public static final String _CHATROOM_NOT_VISIBLE = "Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_VISIBLE = new
ChatRoomState(_CHATROOM_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Required".
+ */
+ public static final String _CHATROOM_PASSWORD_REQUIRED = "Password
Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_REQUIRED = new
ChatRoomState(_CHATROOM_PASSWORD_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Not Required".
+ */
+ public static final String _CHATROOM_PASSWORD_NOT_REQUIRED =
"Password Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_NOT_REQUIRED =
new ChatRoomState(_CHATROOM_PASSWORD_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Required".
+ */
+ public static final String _CHATROOM_INVITATION_REQUIRED =
"Invitation Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUIRED =
new
ChatRoomState(_CHATROOM_INVITATION_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Not Required".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_REQUIRED =
"Invitation Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_REQUIRED

new ChatRoomState(_CHATROOM_INVITATION_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_LIMITED = "User
Number Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_LIMITED =
new
ChatRoomState(_CHATROOM_USER_NUMBER_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Not Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_NOT_LIMITED =
"User
Number Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_NOT_LIMITED

new ChatRoomState(_CHATROOM_USER_NUMBER_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MUTE state.
+ * <p>
+ * This constant has the String value "Mute".
+ */
+ public static final String _CHATROOM_MUTE = "Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * mute state no messages are get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_MUTE = new
ChatRoomState(_CHATROOM_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_MUTE state.
+ * <p>
+ * This constant has the String value "Not Mute".
+ */
+ public static final String _CHATROOM_NOT_MUTE = "Not Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * mute state messages can be get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_NOT_MUTE = new
ChatRoomState(_CHATROOM_NOT_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_ALLOWED =
"External Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * external messages allowed state, this chat room can receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Not
Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED

"External Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * external messages allowed state, this chat room can not receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_REGISTERED state.
+ * <p>
+ * This constant has the String value "Registered".
+ */
+ public static final String _CHATROOM_REGISTERED = "Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_REGISTERED = new
ChatRoomState(_CHATROOM_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Not Registered".
+ */
+ public static final String _CHATROOM_NOT_REGISTERED = "Not
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_REGISTERED = new
ChatRoomState(_CHATROOM_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Locked".
+ */
+ public static final String _CHATROOM_SUBJECT_LOCKED = "Subject
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * subject locked state, only admin users can change the subject
of
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_LOCKED = new
ChatRoomState(_CHATROOM_SUBJECT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Not locked".
+ */
+ public static final String _CHATROOM_SUBJECT_NOT_LOCKED = "Subject
Not locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * subject locked state, all users can change the subject of this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_NOT_LOCKED =
new
ChatRoomState(_CHATROOM_SUBJECT_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_ALLOWED =
"Message Format Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format allowed, all colored, underlined... messages are
allowed.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_ALLOWED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Not Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED =
"Message Format Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format not allowed, all colored, underlined... messages
are not allowed.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_FILTERED =
"Message Format Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format filtered state, all colored, underlined...
messages are seen in standard format
+ * by other users.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_FILTERED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Not Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_FILTERED =
"Message Format Not Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * message format filtered state, all colored, underlined...
messages are seen
+ * by other users.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_LIMITED = "Join
Time
Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * join time limited state, users can only join in an interval of
X time.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_LIMITED = new
ChatRoomState(_CHATROOM_JOIN_TIME_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Not Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_NOT_LIMITED = "Join
Time Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * join time limited state.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_NOT_LIMITED =
new ChatRoomState(_CHATROOM_JOIN_TIME_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_REQUEST_ALLOWED =
"Invitation Request Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation request allowed state, all invitation request are
allowed.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Not
Allowed".
+ */
+ public static final String
_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED
= "Invitation Request Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation request allowed state, all invitation request are
rejected.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Redirected".
+ */
+ public static final String _CHATROOM_USER_REDIRECTED = "User
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * user redirected state, all users which join this chat room are
redirected to an other one.
+ */
+ public static final ChatRoomState CHATROOM_USER_REDIRECTED = new
ChatRoomState(_CHATROOM_USER_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NOT_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Not Redirected".
+ */
+ public static final String _CHATROOM_USER_NOT_REDIRECTED = "User
Not
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * user redirected state, all users which join this chat room are
not redirected.
+ */
+ public static final ChatRoomState CHATROOM_USER_NOT_REDIRECTED =
new
ChatRoomState(_CHATROOM_USER_NOT_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_LOCKED = "Nicknames
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nicknames locked state, users in this chat room can not change
their nickname.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_LOCKED = new
ChatRoomState(_CHATROOM_NICKNAMES_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Not Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_NOT_LOCKED =
"Nicknames Not Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nicknames locked state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_NOT_LOCKED =
new ChatRoomState(_CHATROOM_NICKNAMES_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Locked".
+ */
+ public static final String _CHATROOM_KICK_LOCKED = "Kick Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * kick locked state, kicks are locked on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_KICK_LOCKED = new
ChatRoomState(_CHATROOM_KICK_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Not Locked".
+ */
+ public static final String _CHATROOM_KICK_NOT_LOCKED = "Kick Not
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * kick locked state.
+ */
+ public static final ChatRoomState CHATROOM_KICK_NOT_LOCKED = new
ChatRoomState(_CHATROOM_KICK_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Registered".
+ */
+ public static final String _CHATROOM_USERS_REGISTERED = "Users
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * users registered state, only registered users can join this
room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_REGISTERED = new
ChatRoomState(_CHATROOM_USERS_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Not Registered".
+ */
+ public static final String _CHATROOM_USERS_NOT_REGISTERED = "Users
Not Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * users registered state, all users can join this chat room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_NOT_REGISTERED =
new ChatRoomState(_CHATROOM_USERS_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_ALLOWED =
"Special Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * special messages allowed state.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Not Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED

"Special Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * special messages allowed state, only a specific level type of
message are allowed.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_VISIBLE =
"Nickname List Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAME_LIST_VISIBLE =
new ChatRoomState(_CHATROOM_NICKNAME_LIST_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Not Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_NOT_VISIBLE =
"Nickname List Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState
CHATROOM_NICKNAME_LIST_NOT_VISIBLE
= new ChatRoomState(_CHATROOM_NICKNAME_LIST_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_ALLOWED =
"Invitation Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * invitation allowed state, users can invite other users in this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_ALLOWED =
new
ChatRoomState(_CHATROOM_INVITATION_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Not Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_ALLOWED =
"Invitation Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * invitation allowed state, users can not invite other users in
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_ALLOWED

new ChatRoomState(_CHATROOM_INVITATION_NOT_ALLOWED);
+
+ /**
+ * A string representation of this Chat Room State.
+ */
+ private String chatRoomStateStr;
+
+ /**
+ * Create a chat room state object with a value corresponding to
the specified
+ * string.
+ * @param chatRoomState a string representation of the state.
+ */
+ private ChatRoomState(String chatRoomState)
+ {
+ this.chatRoomStateStr = chatRoomState;
+ }
+
+ /**
+ * Returns a String representation of that chat room State.
+ *
+ * @return a string value (one of the _CHATROOM_XXX constants)
representing
+ * this chat room state).
+ */
+ public String getStateString()
+ {
+ return chatRoomStateStr;
+ }
+
+ /**
+ * Returns a string represenation of this call state. Strings
returned
+ * by this method have the following format:
+ * "ChatRoomState:<STATE_STRING>" and are meant to be used for
loggin/debugging
+ * purposes.
+ * @return a string representation of this object.
+ */
+ public String toString()
+ {
+ return getClass().getName()+":"+getStateString();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy StÔŅĹphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

StÔŅĹphane Remy wrote:

Hello,

Emil, Yana

I've changed some of the services and events, related to the chat
rooms, all i've changed isn't already implemented for irc but i
want you to take a look and tell me if you are ok with what i've
done and maybe add it to sc :).

And if someone else has an idee about changes, additions to do
about multi user chat you are welcome on this thread :wink:

StÔŅĹphane

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

---
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22
Feb 2007 12:37:47 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationRejectedEvent
- extends EventObject
-{
- public InvitationRejectedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v

retrieving revision

1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22
Feb 2007 12:37:18 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -7,6 +7,7 @@
package net.java.sip.communicator.service.protocol.event;

import java.util.*;
+import net.java.sip.communicator.service.protocol.*;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property

of

@@ -14,14 +15,159 @@
* The event contains references to the source chat room and
provider, the name
* of the property that has just changed as well as its old and new

values.

*
- * @author Emil Ivov
+ * @author StÔŅĹphane Remy
*/
public class ChatRoomPropertyChangeEvent
    extends EventObject
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room topic being changed, that means the subject of
this channel
+ * has changed
+ */
+ public static final String TOPIC_CHANGED = "TopicChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode private, that means the channel
is now no more
+ * visible in the list of channels
+ */
+ public static final String MODE_PRIVATE = "ModePrivate";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode secret, that means the channel
is now no more
+ * visible in the list of channels and no one can make a
request on this channel
+ * in order to see if it exists like in irc a whois on a
channel if it is in mode
+ * secret don't response.
+ */
+ public static final String MODE_SECRET = "ModeSecret";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode invite only, that means the
channel can only
+ * be joined by invited members.
+ */
+ public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode topic protected, that means the
channel topic can only
+ * be changed by operators.
+ */
+ public static final String MODE_TOPIC_PROTECTED =

"ModeTopicProtected";

+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode chat room message only, that
means the channel can only receive
+ * messages from a user that is on this channel.
+ */
+ public static final String MODE_CHAT_ROOM_MESSAGE_ONLY =
"ModeChatRoomMessageOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode moderated, that means only user
that have
+ * enough level in this room can send messages.
+ */
+ public static final String MODE_MODERATED = "ModeModerated";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode max user, that means only a max
number of
+ * members can join this chat room.
+ */
+ public static final String MODE_MAX_USER = "ModeMaxUser";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode key, that means that all members

need

+ * a key to join this channel.
+ */
+ public static final String MODE_KEY = "ModeKey";
+
+ /**
+ * The type of this event. Values can be any of the above fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible content of the event
+ * that have occurred, like if a key is set, or a max user

number...

+ */
+ private String content = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String content,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.content = content;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the above
+ * field values.
+ *
+ * @return one of the field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * A reason string indicating the content of this event.
+ *
+ * @return a human readable String containing the content for
this event,
+ * or null if no particular content was specified.
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
    {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
    }

}
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

---
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

22 Feb 2007 12:37:33 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * A listener that is fired anytime an invitation to join a MUC
room is received.
- *
- * @author Emil Ivov
- */
-public interface InvitationListener
-{
- /**
- * Called when we receive an invitation to join an existing

ChatRoom.

- * <p>
- * @param evt the <tt>InvitationReceivedEvent</tt> that
contains the newly
- * received invitation and its source provider.
- */
- public abstract void invitationReceived(InvitationReceivedEvent

evt);

-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v

retrieving revision

1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23
Apr 2007 18:11:36 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role

in the

+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author StÔŅĹphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
    extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole

previousRole,

+ ChatRoomMemberRole newRole)
    {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
    }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is
pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v

retrieving revision

1.1
diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -6,18 +6,109 @@
*/
package net.java.sip.communicator.service.protocol.event;

+import java.util.EventObject;
+
+import net.java.sip.communicator.service.protocol.*;
+
/**
* Dispatched to notify interested parties that a change in our
status in the
* source room has changed. Changes may include us being kicked,

banned, or

* granted admin permissions.
*
* @author Emil Ivov
+ * @author StÔŅĹphane Remy
*/
public class ChatRoomLocalUserStatusChangeEvent
+ extends EventObject
{
- public ChatRoomLocalUserStatusChangeEvent()
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the
MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
    {
- super();
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
    }

+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values
indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/event...

[Message clipped]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#7

Hi Yana,

I've found other problems in the services, can you changes this in ChatRoomConfigParam:

-Change CHAT_ROOM_EXTERNAL_MESSAGE_ALLOWED into CHAT_ROOM_EXTERNAL_MESSAGE_REFUSED

-Change CHAT_ROOM_VISIBLE into CHAT_ROOM_INVISIBLE

-Change CHAT_ROOM_SPECIAL_MESSAGES_ALLOWED into CHAT_ROOM_SPECIAL_MESSAGES_REFUSED

-Change CHAT_ROOM_NICKNAME_LIST_VISIBLE into CHAT_ROOM_NICKNAME_LIST_INVISIBLE

-Change CHAT_ROOM_INVITATION_ALLOWED into CHAT_ROOM_INVITATION_REFUSED

-Change CHAT_ROOM_MESSAGE_FORMAT_ALLOWED into CHAT_ROOM_MESSAGE_FORMAT_BLOCKED

-Change CHAT_ROOM_INVITATION_REQUEST_ALLOWED into CHAT_ROOM_INVITATION_REQUEST_REFUSED

This changes are because by default they are allowed or visible.

Thanks Yana

Stéphane

Yana Stamcheva <yana@sip-communicator.org> a écrit :

···

Hi Stephane,

thanks for the remarks! I've just applied your fixes and committed them
to the CVS.

Yana

Stéphane Remy wrote:

Hi Yana,

Sorry for the late answer. I updated my code with your changes and i'm ok with all you've done. I just noticed two things you forgot to change:

In ChatRoomPropertyChangeEvent:

You forgot to change PROPERTY_STATE_CHANGED into PROPERTY_CONFIG_CHANGED.

In ChatRoomConfigParam:

You forgot to remove _CHAT_ROOM_NOT_VISIBLE.

Stéphane

Yana Stamcheva <yana@sip-communicator.org> a écrit :

Hi Stephane,

very well structured and complete code! You've done a very good work!

I have just committed your code to the cvs. I had to make some minor
modifications so the code fit better to SIP Communicator conventions, you
could see the list of changes below.

General modifications

- Removed special characters from author name - Stéphane was renamed to
Stephane

- Added additional comments where needed

- Renamed
- ChatRoomLocalUserParticipationChangeEvent to
ChatRoomLocalUserPresenceChangeEvent
- ChatRoomLocalUserParticipationListener to
ChatRoomLocalUserPresenceListener -
- ChatRoomMemberParticipationChangeEvent to
ChatRoomMemberPresenceChangeEvent
- ChatRoomMemberParticipationListener to ChatRoomMemberPresenceListener

After a discussion with Emil we decided to take the "Presence" name, it
appears more intuitive

ChatRoom

- Added some additional comments to setUserLimit, addBanMask, removeBanMask,
getBanList, getUserLimit - to explain some more details on what ban mask or
ban list is, what is the user limit about, etc.

- Renamed setState to addConfigParam - we renamed also the ChatRoomState
class to ChatRoomConfigParam. I had a look in the ChatRoomState class and I
would say that properties there are rather configuration patameters and not
chat room states.

- Added removeConfigParam, getSupportedConfigurationParams and
getConfiguration - in order to be able to remove a configuration parameter,
to obtain the list of configuration paramaters supported by the current
implementation and to obtain the current chat room configuration.

- Added getPassword method - it was only a setPassword.

- Removed final modifiers for String and int parameters - Java API says that
"Strings are constant; their values cannot be changed after they are
created" . And ints are not objects and they're copied by value (i.e. a
brand new copy is created and is passed to the method), so the final
modifier is redundant in this case.

ChatRoomState

- Renamed to ChatRoomConfigParam - as I already mentioned the name wasn't
very well fitting the content of the class, so we tried to make it more
intuitive

- Formatted the code - lines were longer than 80 columns

- Added additional comments

- Removed CHAT_ROOM_PASSWORD_NOT_REQUIRED, CHATROOM_INVITATION_NOT_REQUIRED,
CHATROOM_USER_NUMBER_NOT_LIMITED, CHATROOM_NOT_MUTE,
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED, CHATROOM_NOT_REGISTERED,
CHATROOM_SUBJECT_NOT_LOCKED, CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED,
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED, CHATROOM_JOIN_TIME_NOT_LIMITED, etc.

- Renamed CHAT_ROOM_USER_REGISTERED to CHAT_ROOM_ONLY_REGISTERED_USER - I
think it's more intuitive this way

- All _XXX String constants are changed to protected - they will be used
only internaly and may be by descendants

ChatRoomInvitation

- get back the name of the author of the class - should not remove the name
of the author even if the class was almost empty and we wrote the whole
implementation:)

ChatRoomPropertyChangeEvent

- get back the name of the author of the class:)

- Removed the getProtocolProvider method - the protocol provider could be
obtained from the chat room and has nothing to do in the context of this
event

- Removed the reason field - I don't think we need to have the String
reason, I don't really see for what it could be used.

- Added getOldValue and getNewValue methods - in order to be able to obtain
previous and new property values

That's all for now.

Thanks again Stephane and Loic for the great work! I'll continue with the
irc implementation now and soon we'll have all your work on cvs.

If you have any remarks on above changes you're welcome to express yourself.

Regards,
Yana

On 5/21/07, Stéphane Remy <stephane.remy@ulp.u-strasbg.fr> wrote:

Hi Yana,

I have made a lot of changes again to this services, i hope i didn't
forget something, otherwise don't hesitate to tell it to me i will
fixe it.

Quoting Yana Stamcheva <yana@sip-communicator.org>:

Hi Stephane,

Sorry for the late response. You have done really good work here. Bravo!

I would propose just some minor changes to discuss:
- In ChatRoomMemberRoleListener we should called the method
memberRoleChanged, instead of memberStatusChanged. (I think it's a copy
paste error)

I have changed that.

- In ChatRoomInvitatioXXXEvent we should rename the method
getSourceMessage to getSourceInvitation or getChatRoomInvitation,
because actually it returns a ChatRoomInvitation.

It's fixed too.

- After a discussion with Emil we think that it would be correct that
ChatRoomPropertyChangeEvent extends java.beans.PropertyChangeEvent and
thus it should implement getOldValue and getNewValue methods.

For this part i have made a lot of changes, i have used the
java.beans.PropertyChangeEvent, but i have also created a class name
ChatRoomState which contains all the possible states for a chat room.

- We have some doubts for the name TOPIC_CHANGED. In the ChatRoom we
already have a property called "subject", so may be it's better to call
it SUBJECT_CHANGED here also.

It's fixed too.

- In fact all the names of properties in the
ChatRoomPropertyChangeEvent are not very well matching the convention
used for property names. We should change them may be by replacing MODE
with PROPERTY and further more by adjusting better the names so that
they are more intuitive.

I have made them as intuitive as possible this time, but if you find
better words to make them more intuitive just tell me.

- And finally all properties defined in the ChatRoomPropertyChangeEvent
should also exist as properties in the ChatRoom, because they are
actually properties of the chat room and we should be able to get and
set their value from there.

I have changed this too.

That's all for now. May be Emil will have something to add.

I should say one more time congratulations for the work :slight_smile:

Yana

Fot the ChatRoomState class i'm not sure if it is the best way to do,
so tell me what do you think about it.

Stéphane

here is the patch:

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * Dispatched to notify interested parties that a change in our status in
the
- * source room has changed. Changes may include us being kicked, banned,
or
- * granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomLocalUserStatusChangeEvent
-{
- public ChatRoomLocalUserStatusChangeEvent()
- {
- super();
- }
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java 23
Apr 2007 18:11:29
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in the status of the
chat
- * participants in a particular chat room, such as us being kicked,
banned, or
- * granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomMemberListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- */
- public void memberStatusChanged( ChatRoomMemberEvent evt );
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22 Feb 2007 12:37:18
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 21 May 2007 07:05:35
-0000
@@ -6,22 +6,114 @@
*/
package net.java.sip.communicator.service.protocol.event;

-import java.util.*;
+import net.java.sip.communicator.service.protocol.ChatRoom;
+import net.java.sip.communicator.service.protocol.ProtocolProviderService
;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property
of
- * the corresponding chat room (e.g. its subject or type) have been
modified.
+ * the corresponding chat room (e.g. its subject or state) have been
modified.
* The event contains references to the source chat room and
provider, the name
* of the property that has just changed as well as its old and new
values.
*
- * @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomPropertyChangeEvent
- extends EventObject
+ extends java.beans.PropertyChangeEvent
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room subject being changed.
+ */
+ public static final String PROPERTY_SUBJECT_CHANGED =
"SubjectChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room ban list being changed.
+ */
+ public static final String PROPERTY_BAN_LIST_CHANGED =
"BanListChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room user limit being changed.
+ */
+ public static final String PROPERTY_USER_LIMIT_CHANGED =
"UserLimitChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room state changed.
+ */
+ public static final String PROPERTY_STATE_CHANGED = "StateChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room password being changed.
+ */
+ public static final String PROPERTY_PASSWORD_CHANGED =
"PasswordChanged";
+
+ /**
+ * An optional String indicating a possible reason why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom source,
+ String
propertyName,
+ Object oldValue,
+ Object newValue,
+ String reason)
+ {
+ super(source, propertyName, oldValue, newValue);
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with this
+ * event.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns a reference to the protocol provider where the event has
+ * originated.
+ * <p>
+ * @return a reference to the ProtocolProviderService instance where
this
+ * event originated.
+ */
+ public ProtocolProviderService getProtocolProvider()
+ {
+ return getSourceChatRoom().getParentProvider();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
    {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + this.getPropertyName()
+ + " sourceRoom="
+ + this.getSource().toString()
+ + "oldValue="
+ + this.getOldValue().toString()
+ + "newValue="
+ + this.getNewValue().toString()
+ + "]";
    }

}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 23 Apr 2007 18:11:22
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,124 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-import net.java.sip.communicator.service.protocol.*;
-
-/**
- * Dispatched to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomMemberEvent
- extends EventObject
-{
- /**
- * Indicates that this event was triggered as a result of the source
- * participant joining the source chat room.
- */
- public static final String MEMBER_JOINED = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant being "kicked" out of the chat room.
- */
- public static final String MEMBER_LEFT = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant leaving the source chat room.
- */
- public static final String MEMBER_KICKED = "MemberKicked";
-
- /**
- * The member that the event relates to.
- */
- private ChatRoomMember sourceMember = null;
-
- /**
- * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
- */
- private String eventType = null;
-
- /**
- * An optional String indicating a possible reason as to why the
event
- * might have occurred.
- */
- private String reason = null;
-
- public ChatRoomMemberEvent(ChatRoom sourceRoom,
- ChatRoomMember sourceMember,
- String eventType,
- String reason )
- {
- super(sourceRoom);
- this.sourceMember = sourceMember;
- this.eventType = eventType;
- this.reason = reason;
- }
-
- /**
- * Returns the source chat room for this event.
- *
- * @return the <tt>ChatRoom</tt> associated with that is the
source of this
- * event and that the corresponding ChatRoomMemberBelongs to.
- */
- public ChatRoom getChatRoom()
- {
- return (ChatRoom)getSource();
- }
-
- /**
- * Returns the member that this event is pertaining to.
- * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
- */
- public ChatRoomMember getChatRoomMember()
- {
- return sourceMember;
- }
-
- /**
- * A reason string indicating a human readable reason for this event.
- *
- * @return a human readable String containing the reason for this
event,
- * or null if no particular reason was specified.
- */
- public String getReason()
- {
- return reason;
- }
-
- /**
- * Returns the type of this event which could be one of the
MEMBER_XXX-ed
- * member field values.
- *
- * @return one of the MEMBER_XXXed member field values indicating
the type
- * of this event.
- */
- public String getEventType()
- {
- return eventType;
- }
-
- /**
- * Returns a String representation of this event.
- */
- public String toString()
- {
- return "ChatRoomMemberEvent[type="
- + getEventType()
- + " sourceRoom="
- + getChatRoom()
- + " member="
- + getChatRoomMember()
- + "]";
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java 22 Feb 2007 12:36:09
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in our status in the
room
- * such as us being kicked, banned, or granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomLocalUserStatusListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in our status in
the
- * source soom has changed. Changes may include us being kicked,
banned, or
- * granted admin permissions.
- */
- public void
localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt);
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23 Apr 2007 18:11:36
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 21 May 2007 07:05:35
-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
    extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMember sourceMember,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
    {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
    }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
---
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22
Feb
2007 12:35:34 -0000 1.1
+++
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 21
May
2007 07:05:34 -0000
@@ -7,13 +7,42 @@
package net.java.sip.communicator.service.protocol;

/**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a
chat room member
+ * to an other in order to invite this chat room member to join the
chat room this invitation
+ * have for target.
+ *
+ * @author Stéphane Remy
*/
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
{
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no
reason
+ *
+ * @return the reason of this invitation, or null if there is no
reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the
invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the
invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation
has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that
created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
}
Index:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java ---
src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java 22
Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat
room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if
no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/ChatRoom.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoom.java,v retrieving revision 1.4
diff -u -r1.4 ChatRoom.java
--- src/net/java/sip/communicator/service/protocol/ChatRoom.java 24
Apr 2007 12:31:25 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/ChatRoom.java 21
May 2007 07:05:34 -0000
@@ -17,7 +17,6 @@
*/
public interface ChatRoom
{
-
    /**
     * Returns the name of this <tt>ChatRoom</tt>.
     *
@@ -95,25 +94,6 @@
    public void leave();

    /**
- * Adds <tt>listener</tt> to the list of listeners registered to
receive
- * events upon modification of chat room properties such as its
subject
- * for example.
- *
- * @param listener ChatRoomChangeListener
- */
- public void addChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
- * Removes <tt>listener</tt> from the list of listeneres current
registered
- * for chat room modification events.
- *
- * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
- */
- public void removeChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
     * Returns the last known room subject/theme or <tt>null</tt> if the
user
     * hasn't joined the room or the room does not have a subject yet.
     * <p>
@@ -163,41 +143,88 @@
       throws OperationFailedException;

   /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
    *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
    */
- public void addLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void addLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

   /**
- * Removes a listener that was being notified of changes in our status
in
- * the room such as us being kicked, banned, or granted admin
permissions.
+ * Removes a listener that was being notified of changes in our
participation in
+ * the room such as us being kicked, join, left...
    *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
    */
- public void removeLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void removeLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

   /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left...
    *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
    */
- public void addMemberListener(ChatRoomMemberListener listener);
+ public void
addMemberParticipationListener(ChatRoomMemberParticipationListener
listener);

   /**
- * Removes a listener that was being notified of changes in the status
of
- * other chat room participants such as users being kicked, banned, or
- * granted admin permissions.
+ * Removes a listener that was being notified of changes in the
participation of
+ * other chat room participants such as users being kicked, join,
left.
    *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
    */
- public void removeMemberListener(
- ChatRoomMemberListener listener);
-
+ public void
removeMemberParticipationListener(ChatRoomMemberParticipationListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in our role
in the room
+ * such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in our role
in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes of a member
role in the room
+ * such as being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void addMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Removes a listener that was being notified of changes of a
member role in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void removeMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in the
property of the room
+ * such as the subject being change or the room state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
addPropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in the
property of
+ * the chat room such as the subject being change or the room
state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
removePropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
    /**
     * Invites another user to this room.
     * <p>
@@ -285,6 +312,82 @@
     */
    public ProtocolProviderService getParentProvider();

- //include - roominfo
- /** @todo include room info */
+ /**
+ * Sets the password of this chat room. If the user does not have
the right
+ * to change the room password, or the protocol does not support
this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param password the new password that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setPassword(final String password)
+ throws OperationFailedException;
+
+ /**
+ * Adds a ban mask to the list fo ban masks of this chat room. If
the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the new ban mask that we'd like to add to this
room ban list
+ * @throws OperationFailedException
+ */
+ public void addBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Remove a ban mask of the list fo ban masks of this chat room.
If the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the ban mask that we'd like to remove from this
room ban list
+ * @throws OperationFailedException
+ */
+ public void removeBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Sets the user limit of this chat room. If the user does not
have the right
+ * to change the room user limit, or the protocol does not
support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param userLimit the new user limit that we'd like this room to
have
+ * @throws OperationFailedException
+ */
+ public void setUserLimit(final int userLimit)
+ throws OperationFailedException;
+
+ /**
+ * Sets a state of this chat room. If the user does not have the
right
+ * to change the room state, or the protocol does not support this,
or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param state the new state that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setState(ChatRoomState state)
+ throws OperationFailedException;
+
+ /**
+ * Returns the list of ban mask that are currently of this chat room.
+ * @return List the ban list of this room.
+ */
+ public List getBanList();
+
+ /**
+ * Returns the list of states that this chat room is currently in.
+ * @return List the list of states of this chat room.
+ */
+ public List getStateList();
+
+ /**
+ * Returns the limit of user of this chat room, of returns -1 if
there is
+ * no limit.
+ * @return List the list of states of this chat room.
+ */
+ public int getUserLimit();
}
Index:

src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
---
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 23 Apr 2007 18:12:44
-0000 1.4
+++
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 21 May 2007 07:05:35
-0000
@@ -45,11 +45,11 @@
    public List getCurrentlyJoinedChatRooms();

    /**
- * Returns a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
     * currently active in.
     *
- * @param contact the contact whose current ChatRooms we will be
querying.
- * @return a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * @param chatRoomMember the chatRoomMember whose current
ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
     * currently active in.
     *
     * @throws OperationFailedException if an error occurs while trying
to
@@ -57,7 +57,7 @@
     * @throws OperationNotSupportedException if the server does not
support
     * multi user chat
     */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember
chatRoomMember)
        throws OperationFailedException, OperationNotSupportedException;

    /**
@@ -110,7 +110,7 @@
     *
     * @param listener an invitation listener.
     */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener
listener);

    /**
     * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
     *
     * @param listener the invitation listener to remove.
     */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener
listener);

    /**
     * Adds a listener to invitation notifications. The listener
will be fired
@@ -127,7 +127,7 @@
     * @param listener an invitation listener.
     */
    public void addInvitationRejectionListener(
- InvitationRejectionListener
listener);
+
ChatRoomInvitationRejectionListener listener);

    /**
     * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,14 +136,5 @@
     * @param listener the invitation listener to remove.
     */
    public void removeInvitationRejectionListener(
- InvitationRejectionListener
listener);
-
- /**
- * Returns true if <tt>contact</tt> supports multi user chat
sessions.
- *
- * @param contact reference to the contact whose support for chat
rooms
- * we are currently querying.
- * @return a boolean indicating whether <tt>contact</tt> supports
chatrooms.
- */
- public boolean isMultiChatSupportedByContact(Contact contact);
+
ChatRoomInvitationRejectionListener listener);
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,25 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomLocalUserParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in our
participation in the
+ * source soom has occured. Changes may include us being kicked,
join, left.
+ */
+ public void
localUserParticipationChanged(ChatRoomLocalUserParticipationChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room
is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that
contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void
invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,28 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomLocalUserRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,112 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.EventObject;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our
paticipation in the
+ * source room has occured. Changes may include us being kicked,
join, left...
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserParticipationChangeEvent(ChatRoom sourceRoom,
+
String eventType,
+
String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,131 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in the
participation of the
+ * source room participant has changed. Changes may include the
participant
+ * being kicked, join, left...
+ *
+ * @author Emil Ivov
+ */
+public class ChatRoomMemberParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomMemberParticipationChangeEvent(ChatRoom
sourceRoom,
+ ChatRoomMember sourceMember,
+ String eventType,
+ String reason )
+ {
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getChatRoomMember()
+ {
+ return sourceMember;
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomMemberEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom().toString()
+ + " member="
+ + getChatRoomMember().toString()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which
was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by
us.
+ *
+ * @param evt the instance of the
<tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the
participation of the chat
+ * member in a particular chat room, such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomMemberParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the
participation of the
+ * source room member has changed. Changes may include the
participant
+ * being kicked, join, left.
+ */
+ public void
memberParticipationChanged(ChatRoomMemberParticipationChangeEvent evt );
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a
rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is
no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt>
representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,77 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserRoleChangeEvent
+ extends EventObject
+{
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
+ {
+ super(sourceRoom);
+ this.previousRole = previousRole;
+ this.newRole = newRole;
+ }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing
reception of the
+ * <tt>source</tt> invitation received from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/ChatRoomState.java

RCS file:
src/net/java/sip/communicator/service/protocol/ChatRoomState.java
diff -N src/net/java/sip/communicator/service/protocol/ChatRoomState.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/ChatRoomState.java 1
Jan 1970 00:00:00 -0000
@@ -0,0 +1,589 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+/**
+ * The ChatRoomState class reflects the current state of a chat room.
+ *
+ * @author Stéphane Remy
+ */
+public class ChatRoomState
+{
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_VISIBLE state.
+ * <p>
+ * This constant has the String value "Visible".
+ */
+ public static final String _CHATROOM_VISIBLE = "Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_VISIBLE = new
ChatRoomState(_CHATROOM_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Not Visible".
+ */
+ public static final String _CHATROOM_NOT_VISIBLE = "Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_VISIBLE = new
ChatRoomState(_CHATROOM_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Required".
+ */
+ public static final String _CHATROOM_PASSWORD_REQUIRED = "Password
Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_REQUIRED = new
ChatRoomState(_CHATROOM_PASSWORD_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Not Required".
+ */
+ public static final String _CHATROOM_PASSWORD_NOT_REQUIRED =
"Password Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_NOT_REQUIRED =
new ChatRoomState(_CHATROOM_PASSWORD_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Required".
+ */
+ public static final String _CHATROOM_INVITATION_REQUIRED =
"Invitation Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUIRED =
new
ChatRoomState(_CHATROOM_INVITATION_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Not Required".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_REQUIRED =
"Invitation Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_REQUIRED

new ChatRoomState(_CHATROOM_INVITATION_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_LIMITED = "User
Number Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_LIMITED =
new
ChatRoomState(_CHATROOM_USER_NUMBER_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Not Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_NOT_LIMITED =
"User
Number Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_NOT_LIMITED

new ChatRoomState(_CHATROOM_USER_NUMBER_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MUTE state.
+ * <p>
+ * This constant has the String value "Mute".
+ */
+ public static final String _CHATROOM_MUTE = "Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * mute state no messages are get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_MUTE = new
ChatRoomState(_CHATROOM_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_MUTE state.
+ * <p>
+ * This constant has the String value "Not Mute".
+ */
+ public static final String _CHATROOM_NOT_MUTE = "Not Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * mute state messages can be get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_NOT_MUTE = new
ChatRoomState(_CHATROOM_NOT_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_ALLOWED =
"External Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * external messages allowed state, this chat room can receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Not
Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED

"External Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * external messages allowed state, this chat room can not receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_REGISTERED state.
+ * <p>
+ * This constant has the String value "Registered".
+ */
+ public static final String _CHATROOM_REGISTERED = "Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_REGISTERED = new
ChatRoomState(_CHATROOM_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Not Registered".
+ */
+ public static final String _CHATROOM_NOT_REGISTERED = "Not
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_REGISTERED = new
ChatRoomState(_CHATROOM_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Locked".
+ */
+ public static final String _CHATROOM_SUBJECT_LOCKED = "Subject
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * subject locked state, only admin users can change the subject
of
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_LOCKED = new
ChatRoomState(_CHATROOM_SUBJECT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Not locked".
+ */
+ public static final String _CHATROOM_SUBJECT_NOT_LOCKED = "Subject
Not locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * subject locked state, all users can change the subject of this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_NOT_LOCKED =
new
ChatRoomState(_CHATROOM_SUBJECT_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_ALLOWED =
"Message Format Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format allowed, all colored, underlined... messages are
allowed.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_ALLOWED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Not Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED =
"Message Format Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format not allowed, all colored, underlined... messages
are not allowed.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_FILTERED =
"Message Format Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format filtered state, all colored, underlined...
messages are seen in standard format
+ * by other users.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_FILTERED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Not Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_FILTERED =
"Message Format Not Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * message format filtered state, all colored, underlined...
messages are seen
+ * by other users.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_LIMITED = "Join
Time
Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * join time limited state, users can only join in an interval of
X time.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_LIMITED = new
ChatRoomState(_CHATROOM_JOIN_TIME_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Not Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_NOT_LIMITED = "Join
Time Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * join time limited state.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_NOT_LIMITED =
new ChatRoomState(_CHATROOM_JOIN_TIME_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_REQUEST_ALLOWED =
"Invitation Request Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation request allowed state, all invitation request are
allowed.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Not
Allowed".
+ */
+ public static final String
_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED
= "Invitation Request Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation request allowed state, all invitation request are
rejected.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Redirected".
+ */
+ public static final String _CHATROOM_USER_REDIRECTED = "User
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * user redirected state, all users which join this chat room are
redirected to an other one.
+ */
+ public static final ChatRoomState CHATROOM_USER_REDIRECTED = new
ChatRoomState(_CHATROOM_USER_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NOT_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Not Redirected".
+ */
+ public static final String _CHATROOM_USER_NOT_REDIRECTED = "User
Not
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * user redirected state, all users which join this chat room are
not redirected.
+ */
+ public static final ChatRoomState CHATROOM_USER_NOT_REDIRECTED =
new
ChatRoomState(_CHATROOM_USER_NOT_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_LOCKED = "Nicknames
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nicknames locked state, users in this chat room can not change
their nickname.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_LOCKED = new
ChatRoomState(_CHATROOM_NICKNAMES_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Not Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_NOT_LOCKED =
"Nicknames Not Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nicknames locked state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_NOT_LOCKED =
new ChatRoomState(_CHATROOM_NICKNAMES_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Locked".
+ */
+ public static final String _CHATROOM_KICK_LOCKED = "Kick Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * kick locked state, kicks are locked on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_KICK_LOCKED = new
ChatRoomState(_CHATROOM_KICK_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Not Locked".
+ */
+ public static final String _CHATROOM_KICK_NOT_LOCKED = "Kick Not
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * kick locked state.
+ */
+ public static final ChatRoomState CHATROOM_KICK_NOT_LOCKED = new
ChatRoomState(_CHATROOM_KICK_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Registered".
+ */
+ public static final String _CHATROOM_USERS_REGISTERED = "Users
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * users registered state, only registered users can join this
room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_REGISTERED = new
ChatRoomState(_CHATROOM_USERS_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Not Registered".
+ */
+ public static final String _CHATROOM_USERS_NOT_REGISTERED = "Users
Not Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * users registered state, all users can join this chat room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_NOT_REGISTERED =
new ChatRoomState(_CHATROOM_USERS_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_ALLOWED =
"Special Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * special messages allowed state.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Not Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED

"Special Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * special messages allowed state, only a specific level type of
message are allowed.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_VISIBLE =
"Nickname List Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAME_LIST_VISIBLE =
new ChatRoomState(_CHATROOM_NICKNAME_LIST_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Not Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_NOT_VISIBLE =
"Nickname List Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState
CHATROOM_NICKNAME_LIST_NOT_VISIBLE
= new ChatRoomState(_CHATROOM_NICKNAME_LIST_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_ALLOWED =
"Invitation Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * invitation allowed state, users can invite other users in this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_ALLOWED =
new
ChatRoomState(_CHATROOM_INVITATION_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Not Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_ALLOWED =
"Invitation Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * invitation allowed state, users can not invite other users in
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_ALLOWED

new ChatRoomState(_CHATROOM_INVITATION_NOT_ALLOWED);
+
+ /**
+ * A string representation of this Chat Room State.
+ */
+ private String chatRoomStateStr;
+
+ /**
+ * Create a chat room state object with a value corresponding to
the specified
+ * string.
+ * @param chatRoomState a string representation of the state.
+ */
+ private ChatRoomState(String chatRoomState)
+ {
+ this.chatRoomStateStr = chatRoomState;
+ }
+
+ /**
+ * Returns a String representation of that chat room State.
+ *
+ * @return a string value (one of the _CHATROOM_XXX constants)
representing
+ * this chat room state).
+ */
+ public String getStateString()
+ {
+ return chatRoomStateStr;
+ }
+
+ /**
+ * Returns a string represenation of this call state. Strings
returned
+ * by this method have the following format:
+ * "ChatRoomState:<STATE_STRING>" and are meant to be used for
loggin/debugging
+ * purposes.
+ * @return a string representation of this object.
+ */
+ public String toString()
+ {
+ return getClass().getName()+":"+getStateString();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

Stéphane Remy wrote:

Hello,

Emil, Yana

I've changed some of the services and events, related to the chat
rooms, all i've changed isn't already implemented for irc but i
want you to take a look and tell me if you are ok with what i've
done and maybe add it to sc :).

And if someone else has an idee about changes, additions to do
about multi user chat you are welcome on this thread :wink:

Stéphane

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java ---
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22
Feb 2007 12:37:47 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationRejectedEvent
- extends EventObject
-{
- public InvitationRejectedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22
Feb 2007 12:37:18 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -7,6 +7,7 @@
package net.java.sip.communicator.service.protocol.event;

import java.util.*;
+import net.java.sip.communicator.service.protocol.*;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property

of

@@ -14,14 +15,159 @@
* The event contains references to the source chat room and
provider, the name
* of the property that has just changed as well as its old and new

values.

*
- * @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomPropertyChangeEvent
   extends EventObject
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room topic being changed, that means the subject of
this channel
+ * has changed
+ */
+ public static final String TOPIC_CHANGED = "TopicChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode private, that means the channel
is now no more
+ * visible in the list of channels
+ */
+ public static final String MODE_PRIVATE = "ModePrivate";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode secret, that means the channel
is now no more
+ * visible in the list of channels and no one can make a
request on this channel
+ * in order to see if it exists like in irc a whois on a
channel if it is in mode
+ * secret don't response.
+ */
+ public static final String MODE_SECRET = "ModeSecret";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode invite only, that means the
channel can only
+ * be joined by invited members.
+ */
+ public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode topic protected, that means the
channel topic can only
+ * be changed by operators.
+ */
+ public static final String MODE_TOPIC_PROTECTED =

"ModeTopicProtected";

+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode chat room message only, that
means the channel can only receive
+ * messages from a user that is on this channel.
+ */
+ public static final String MODE_CHAT_ROOM_MESSAGE_ONLY =
"ModeChatRoomMessageOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode moderated, that means only user
that have
+ * enough level in this room can send messages.
+ */
+ public static final String MODE_MODERATED = "ModeModerated";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode max user, that means only a max
number of
+ * members can join this chat room.
+ */
+ public static final String MODE_MAX_USER = "ModeMaxUser";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode key, that means that all members

need

+ * a key to join this channel.
+ */
+ public static final String MODE_KEY = "ModeKey";
+
+ /**
+ * The type of this event. Values can be any of the above fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible content of the event
+ * that have occurred, like if a key is set, or a max user

number...

+ */
+ private String content = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String content,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.content = content;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the above
+ * field values.
+ *
+ * @return one of the field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * A reason string indicating the content of this event.
+ *
+ * @return a human readable String containing the content for
this event,
+ * or null if no particular content was specified.
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
   {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
   }

}
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java ---
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java 22 Feb 2007 12:37:33 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * A listener that is fired anytime an invitation to join a MUC
room is received.
- *
- * @author Emil Ivov
- */
-public interface InvitationListener
-{
- /**
- * Called when we receive an invitation to join an existing

ChatRoom.

- * <p>
- * @param evt the <tt>InvitationReceivedEvent</tt> that
contains the newly
- * received invitation and its source provider.
- */
- public abstract void invitationReceived(InvitationReceivedEvent

evt);

-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23
Apr 2007 18:11:36 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role

in the

+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
   extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole

previousRole,

+ ChatRoomMemberRole newRole)
   {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
   }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is
pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -6,18 +6,109 @@
*/
package net.java.sip.communicator.service.protocol.event;

+import java.util.EventObject;
+
+import net.java.sip.communicator.service.protocol.*;
+
/**
* Dispatched to notify interested parties that a change in our
status in the
* source room has changed. Changes may include us being kicked,

banned, or

* granted admin permissions.
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomLocalUserStatusChangeEvent
+ extends EventObject
{
- public ChatRoomLocalUserStatusChangeEvent()
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the
MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
   {
- super();
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
   }

+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values
indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/event...

[Message clipped]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

--
Vous êtes unique, comme tout le monde!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#8

Hi StÔŅĹphane,

I understand what is bothering you. When I started renaming the fields as you proposed I couldn't get rid of the idea that all these are actually properties of the chat room. Finally after an off-list discussion with Emil we've decided to make all known configuration params - properties in the chat room and to have a method that allows to add advanced configuration properties by specifying a property name and value. You could have a look at the ChatRoom interface and see how it looks after the modifications.

I have some doubts about some of the properties and I would like to ask you to have a more detailed look at the following methods:

- isAllowInvitationSend, isAllowInvitationReceive (respectively the set methods) - these methods correspond the following params: CHATROOM_INVITATION_ALLOWED, CHATROOM_INVITATION_REQUEST_ALLOWED. The names of the properties were a little confusing (the direction of the invitation is not clear) and I've tried to make them more understandable, but I'm not sure if I understand correctly their meaning. Also if you have another suggestion for the name if you don't like that?

- isAllowMessageFormatting, isFilterMessageFormatting - these two correspond to CHATROOM_MESSAGE_FORMAT_ALLOWED, CHATROOM_MESSAGE_FORMAT_FILTERED. Is it possible to be in a message format allowed mode and to have formatted messages filtered?

That's all.

Also, any comments and corrections are appreciated:))

Yana

StÔŅĹphane Remy wrote:

···

Hi Yana,

I've found other problems in the services, can you changes this in ChatRoomConfigParam:

-Change CHAT_ROOM_EXTERNAL_MESSAGE_ALLOWED into CHAT_ROOM_EXTERNAL_MESSAGE_REFUSED

-Change CHAT_ROOM_VISIBLE into CHAT_ROOM_INVISIBLE

-Change CHAT_ROOM_SPECIAL_MESSAGES_ALLOWED into CHAT_ROOM_SPECIAL_MESSAGES_REFUSED

-Change CHAT_ROOM_NICKNAME_LIST_VISIBLE into CHAT_ROOM_NICKNAME_LIST_INVISIBLE

-Change CHAT_ROOM_INVITATION_ALLOWED into CHAT_ROOM_INVITATION_REFUSED

-Change CHAT_ROOM_MESSAGE_FORMAT_ALLOWED into CHAT_ROOM_MESSAGE_FORMAT_BLOCKED

-Change CHAT_ROOM_INVITATION_REQUEST_ALLOWED into CHAT_ROOM_INVITATION_REQUEST_REFUSED

This changes are because by default they are allowed or visible.

Thanks Yana

StÔŅĹphane

Yana Stamcheva <yana@sip-communicator.org> a ÔŅĹcrit :

Hi Stephane,

thanks for the remarks! I've just applied your fixes and committed them
to the CVS.

Yana

StÔŅĹphane Remy wrote:

Hi Yana,

Sorry for the late answer. I updated my code with your changes and i'm ok with all you've done. I just noticed two things you forgot to change:

In ChatRoomPropertyChangeEvent:

You forgot to change PROPERTY_STATE_CHANGED into PROPERTY_CONFIG_CHANGED.

In ChatRoomConfigParam:

You forgot to remove _CHAT_ROOM_NOT_VISIBLE.

StÔŅĹphane

Yana Stamcheva <yana@sip-communicator.org> a ÔŅĹcrit :

Hi Stephane,

very well structured and complete code! You've done a very good work!

I have just committed your code to the cvs. I had to make some minor
modifications so the code fit better to SIP Communicator conventions, you
could see the list of changes below.

General modifications

- Removed special characters from author name - StÔŅĹphane was renamed to
Stephane

- Added additional comments where needed

- Renamed
- ChatRoomLocalUserParticipationChangeEvent to
ChatRoomLocalUserPresenceChangeEvent
- ChatRoomLocalUserParticipationListener to
ChatRoomLocalUserPresenceListener -
- ChatRoomMemberParticipationChangeEvent to
ChatRoomMemberPresenceChangeEvent
- ChatRoomMemberParticipationListener to ChatRoomMemberPresenceListener

After a discussion with Emil we decided to take the "Presence" name, it
appears more intuitive

ChatRoom

- Added some additional comments to setUserLimit, addBanMask, removeBanMask,
getBanList, getUserLimit - to explain some more details on what ban mask or
ban list is, what is the user limit about, etc.

- Renamed setState to addConfigParam - we renamed also the ChatRoomState
class to ChatRoomConfigParam. I had a look in the ChatRoomState class and I
would say that properties there are rather configuration patameters and not
chat room states.

- Added removeConfigParam, getSupportedConfigurationParams and
getConfiguration - in order to be able to remove a configuration parameter,
to obtain the list of configuration paramaters supported by the current
implementation and to obtain the current chat room configuration.

- Added getPassword method - it was only a setPassword.

- Removed final modifiers for String and int parameters - Java API says that
"Strings are constant; their values cannot be changed after they are
created" . And ints are not objects and they're copied by value (i.e. a
brand new copy is created and is passed to the method), so the final
modifier is redundant in this case.

ChatRoomState

- Renamed to ChatRoomConfigParam - as I already mentioned the name wasn't
very well fitting the content of the class, so we tried to make it more
intuitive

- Formatted the code - lines were longer than 80 columns

- Added additional comments

- Removed CHAT_ROOM_PASSWORD_NOT_REQUIRED, CHATROOM_INVITATION_NOT_REQUIRED,
CHATROOM_USER_NUMBER_NOT_LIMITED, CHATROOM_NOT_MUTE,
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED, CHATROOM_NOT_REGISTERED,
CHATROOM_SUBJECT_NOT_LOCKED, CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED,
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED, CHATROOM_JOIN_TIME_NOT_LIMITED, etc.

- Renamed CHAT_ROOM_USER_REGISTERED to CHAT_ROOM_ONLY_REGISTERED_USER - I
think it's more intuitive this way

- All _XXX String constants are changed to protected - they will be used
only internaly and may be by descendants

ChatRoomInvitation

- get back the name of the author of the class - should not remove the name
of the author even if the class was almost empty and we wrote the whole
implementation:)

ChatRoomPropertyChangeEvent

- get back the name of the author of the class:)

- Removed the getProtocolProvider method - the protocol provider could be
obtained from the chat room and has nothing to do in the context of this
event

- Removed the reason field - I don't think we need to have the String
reason, I don't really see for what it could be used.

- Added getOldValue and getNewValue methods - in order to be able to obtain
previous and new property values

That's all for now.

Thanks again Stephane and Loic for the great work! I'll continue with the
irc implementation now and soon we'll have all your work on cvs.

If you have any remarks on above changes you're welcome to express yourself.

Regards,
Yana

On 5/21/07, StÔŅĹphane Remy <stephane.remy@ulp.u-strasbg.fr> wrote:

Hi Yana,

I have made a lot of changes again to this services, i hope i didn't
forget something, otherwise don't hesitate to tell it to me i will
fixe it.

Quoting Yana Stamcheva <yana@sip-communicator.org>:

Hi Stephane,

Sorry for the late response. You have done really good work here. Bravo!

I would propose just some minor changes to discuss:
- In ChatRoomMemberRoleListener we should called the method
memberRoleChanged, instead of memberStatusChanged. (I think it's a copy
paste error)

I have changed that.

- In ChatRoomInvitatioXXXEvent we should rename the method
getSourceMessage to getSourceInvitation or getChatRoomInvitation,
because actually it returns a ChatRoomInvitation.

It's fixed too.

- After a discussion with Emil we think that it would be correct that
ChatRoomPropertyChangeEvent extends java.beans.PropertyChangeEvent and
thus it should implement getOldValue and getNewValue methods.

For this part i have made a lot of changes, i have used the
java.beans.PropertyChangeEvent, but i have also created a class name
ChatRoomState which contains all the possible states for a chat room.

- We have some doubts for the name TOPIC_CHANGED. In the ChatRoom we
already have a property called "subject", so may be it's better to call
it SUBJECT_CHANGED here also.

It's fixed too.

- In fact all the names of properties in the
ChatRoomPropertyChangeEvent are not very well matching the convention
used for property names. We should change them may be by replacing MODE
with PROPERTY and further more by adjusting better the names so that
they are more intuitive.

I have made them as intuitive as possible this time, but if you find
better words to make them more intuitive just tell me.

- And finally all properties defined in the ChatRoomPropertyChangeEvent
should also exist as properties in the ChatRoom, because they are
actually properties of the chat room and we should be able to get and
set their value from there.

I have changed this too.

That's all for now. May be Emil will have something to add.

I should say one more time congratulations for the work :slight_smile:

Yana

Fot the ChatRoomState class i'm not sure if it is the best way to do,
so tell me what do you think about it.

StÔŅĹphane

here is the patch:

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * Dispatched to notify interested parties that a change in our status in
the
- * source room has changed. Changes may include us being kicked, banned,
or
- * granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomLocalUserStatusChangeEvent
-{
- public ChatRoomLocalUserStatusChangeEvent()
- {
- super();
- }
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java 23
Apr 2007 18:11:29
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in the status of the
chat
- * participants in a particular chat room, such as us being kicked,
banned, or
- * granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomMemberListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- */
- public void memberStatusChanged( ChatRoomMemberEvent evt );
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22 Feb 2007 12:37:18
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 21 May 2007 07:05:35
-0000
@@ -6,22 +6,114 @@
*/
package net.java.sip.communicator.service.protocol.event;

-import java.util.*;
+import net.java.sip.communicator.service.protocol.ChatRoom;
+import net.java.sip.communicator.service.protocol.ProtocolProviderService
;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property
of
- * the corresponding chat room (e.g. its subject or type) have been
modified.
+ * the corresponding chat room (e.g. its subject or state) have been
modified.
* The event contains references to the source chat room and
provider, the name
* of the property that has just changed as well as its old and new
values.
*
- * @author Emil Ivov
+ * @author StÔŅĹphane Remy
*/
public class ChatRoomPropertyChangeEvent
- extends EventObject
+ extends java.beans.PropertyChangeEvent
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room subject being changed.
+ */
+ public static final String PROPERTY_SUBJECT_CHANGED =
"SubjectChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room ban list being changed.
+ */
+ public static final String PROPERTY_BAN_LIST_CHANGED =
"BanListChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room user limit being changed.
+ */
+ public static final String PROPERTY_USER_LIMIT_CHANGED =
"UserLimitChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room state changed.
+ */
+ public static final String PROPERTY_STATE_CHANGED = "StateChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room password being changed.
+ */
+ public static final String PROPERTY_PASSWORD_CHANGED =
"PasswordChanged";
+
+ /**
+ * An optional String indicating a possible reason why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom source,
+ String
propertyName,
+ Object oldValue,
+ Object newValue,
+ String reason)
+ {
+ super(source, propertyName, oldValue, newValue);
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with this
+ * event.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns a reference to the protocol provider where the event has
+ * originated.
+ * <p>
+ * @return a reference to the ProtocolProviderService instance where
this
+ * event originated.
+ */
+ public ProtocolProviderService getProtocolProvider()
+ {
+ return getSourceChatRoom().getParentProvider();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
    {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + this.getPropertyName()
+ + " sourceRoom="
+ + this.getSource().toString()
+ + "oldValue="
+ + this.getOldValue().toString()
+ + "newValue="
+ + this.getNewValue().toString()
+ + "]";
    }

}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 23 Apr 2007 18:11:22
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,124 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-import net.java.sip.communicator.service.protocol.*;
-
-/**
- * Dispatched to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomMemberEvent
- extends EventObject
-{
- /**
- * Indicates that this event was triggered as a result of the source
- * participant joining the source chat room.
- */
- public static final String MEMBER_JOINED = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant being "kicked" out of the chat room.
- */
- public static final String MEMBER_LEFT = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant leaving the source chat room.
- */
- public static final String MEMBER_KICKED = "MemberKicked";
-
- /**
- * The member that the event relates to.
- */
- private ChatRoomMember sourceMember = null;
-
- /**
- * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
- */
- private String eventType = null;
-
- /**
- * An optional String indicating a possible reason as to why the
event
- * might have occurred.
- */
- private String reason = null;
-
- public ChatRoomMemberEvent(ChatRoom sourceRoom,
- ChatRoomMember sourceMember,
- String eventType,
- String reason )
- {
- super(sourceRoom);
- this.sourceMember = sourceMember;
- this.eventType = eventType;
- this.reason = reason;
- }
-
- /**
- * Returns the source chat room for this event.
- *
- * @return the <tt>ChatRoom</tt> associated with that is the
source of this
- * event and that the corresponding ChatRoomMemberBelongs to.
- */
- public ChatRoom getChatRoom()
- {
- return (ChatRoom)getSource();
- }
-
- /**
- * Returns the member that this event is pertaining to.
- * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
- */
- public ChatRoomMember getChatRoomMember()
- {
- return sourceMember;
- }
-
- /**
- * A reason string indicating a human readable reason for this event.
- *
- * @return a human readable String containing the reason for this
event,
- * or null if no particular reason was specified.
- */
- public String getReason()
- {
- return reason;
- }
-
- /**
- * Returns the type of this event which could be one of the
MEMBER_XXX-ed
- * member field values.
- *
- * @return one of the MEMBER_XXXed member field values indicating
the type
- * of this event.
- */
- public String getEventType()
- {
- return eventType;
- }
-
- /**
- * Returns a String representation of this event.
- */
- public String toString()
- {
- return "ChatRoomMemberEvent[type="
- + getEventType()
- + " sourceRoom="
- + getChatRoom()
- + " member="
- + getChatRoomMember()
- + "]";
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java 22 Feb 2007 12:36:09
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in our status in the
room
- * such as us being kicked, banned, or granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomLocalUserStatusListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in our status in
the
- * source soom has changed. Changes may include us being kicked,
banned, or
- * granted admin permissions.
- */
- public void
localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt);
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23 Apr 2007 18:11:36
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 21 May 2007 07:05:35
-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author StÔŅĹphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
    extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMember sourceMember,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
    {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
    }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
---
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22
Feb
2007 12:35:34 -0000 1.1
+++
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 21
May
2007 07:05:34 -0000
@@ -7,13 +7,42 @@
package net.java.sip.communicator.service.protocol;

/**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a
chat room member
+ * to an other in order to invite this chat room member to join the
chat room this invitation
+ * have for target.
+ *
+ * @author StÔŅĹphane Remy
*/
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
{
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no
reason
+ *
+ * @return the reason of this invitation, or null if there is no
reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the
invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the
invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation
has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that
created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
}
Index:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java ---
src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java 22
Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat
room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if
no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/ChatRoom.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoom.java,v retrieving revision 1.4
diff -u -r1.4 ChatRoom.java
--- src/net/java/sip/communicator/service/protocol/ChatRoom.java 24
Apr 2007 12:31:25 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/ChatRoom.java 21
May 2007 07:05:34 -0000
@@ -17,7 +17,6 @@
*/
public interface ChatRoom
{
-
    /**
     * Returns the name of this <tt>ChatRoom</tt>.
     *
@@ -95,25 +94,6 @@
    public void leave();

    /**
- * Adds <tt>listener</tt> to the list of listeners registered to
receive
- * events upon modification of chat room properties such as its
subject
- * for example.
- *
- * @param listener ChatRoomChangeListener
- */
- public void addChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
- * Removes <tt>listener</tt> from the list of listeneres current
registered
- * for chat room modification events.
- *
- * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
- */
- public void removeChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
     * Returns the last known room subject/theme or <tt>null</tt> if the
user
     * hasn't joined the room or the room does not have a subject yet.
     * <p>
@@ -163,41 +143,88 @@
       throws OperationFailedException;

   /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
    *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
    */
- public void addLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void addLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

   /**
- * Removes a listener that was being notified of changes in our status
in
- * the room such as us being kicked, banned, or granted admin
permissions.
+ * Removes a listener that was being notified of changes in our
participation in
+ * the room such as us being kicked, join, left...
    *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
    */
- public void removeLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void removeLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

   /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left...
    *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
    */
- public void addMemberListener(ChatRoomMemberListener listener);
+ public void
addMemberParticipationListener(ChatRoomMemberParticipationListener
listener);

   /**
- * Removes a listener that was being notified of changes in the status
of
- * other chat room participants such as users being kicked, banned, or
- * granted admin permissions.
+ * Removes a listener that was being notified of changes in the
participation of
+ * other chat room participants such as users being kicked, join,
left.
    *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
    */
- public void removeMemberListener(
- ChatRoomMemberListener listener);
-
+ public void
removeMemberParticipationListener(ChatRoomMemberParticipationListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in our role
in the room
+ * such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in our role
in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes of a member
role in the room
+ * such as being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void addMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Removes a listener that was being notified of changes of a
member role in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void removeMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in the
property of the room
+ * such as the subject being change or the room state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
addPropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in the
property of
+ * the chat room such as the subject being change or the room
state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
removePropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
    /**
     * Invites another user to this room.
     * <p>
@@ -285,6 +312,82 @@
     */
    public ProtocolProviderService getParentProvider();

- //include - roominfo
- /** @todo include room info */
+ /**
+ * Sets the password of this chat room. If the user does not have
the right
+ * to change the room password, or the protocol does not support
this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param password the new password that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setPassword(final String password)
+ throws OperationFailedException;
+
+ /**
+ * Adds a ban mask to the list fo ban masks of this chat room. If
the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the new ban mask that we'd like to add to this
room ban list
+ * @throws OperationFailedException
+ */
+ public void addBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Remove a ban mask of the list fo ban masks of this chat room.
If the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the ban mask that we'd like to remove from this
room ban list
+ * @throws OperationFailedException
+ */
+ public void removeBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Sets the user limit of this chat room. If the user does not
have the right
+ * to change the room user limit, or the protocol does not
support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param userLimit the new user limit that we'd like this room to
have
+ * @throws OperationFailedException
+ */
+ public void setUserLimit(final int userLimit)
+ throws OperationFailedException;
+
+ /**
+ * Sets a state of this chat room. If the user does not have the
right
+ * to change the room state, or the protocol does not support this,
or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param state the new state that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setState(ChatRoomState state)
+ throws OperationFailedException;
+
+ /**
+ * Returns the list of ban mask that are currently of this chat room.
+ * @return List the ban list of this room.
+ */
+ public List getBanList();
+
+ /**
+ * Returns the list of states that this chat room is currently in.
+ * @return List the list of states of this chat room.
+ */
+ public List getStateList();
+
+ /**
+ * Returns the limit of user of this chat room, of returns -1 if
there is
+ * no limit.
+ * @return List the list of states of this chat room.
+ */
+ public int getUserLimit();
}
Index:

src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
---
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 23 Apr 2007 18:12:44
-0000 1.4
+++
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 21 May 2007 07:05:35
-0000
@@ -45,11 +45,11 @@
    public List getCurrentlyJoinedChatRooms();

    /**
- * Returns a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
     * currently active in.
     *
- * @param contact the contact whose current ChatRooms we will be
querying.
- * @return a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * @param chatRoomMember the chatRoomMember whose current
ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
     * currently active in.
     *
     * @throws OperationFailedException if an error occurs while trying
to
@@ -57,7 +57,7 @@
     * @throws OperationNotSupportedException if the server does not
support
     * multi user chat
     */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember
chatRoomMember)
        throws OperationFailedException, OperationNotSupportedException;

    /**
@@ -110,7 +110,7 @@
     *
     * @param listener an invitation listener.
     */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener
listener);

    /**
     * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
     *
     * @param listener the invitation listener to remove.
     */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener
listener);

    /**
     * Adds a listener to invitation notifications. The listener
will be fired
@@ -127,7 +127,7 @@
     * @param listener an invitation listener.
     */
    public void addInvitationRejectionListener(
- InvitationRejectionListener
listener);
+
ChatRoomInvitationRejectionListener listener);

    /**
     * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,14 +136,5 @@
     * @param listener the invitation listener to remove.
     */
    public void removeInvitationRejectionListener(
- InvitationRejectionListener
listener);
-
- /**
- * Returns true if <tt>contact</tt> supports multi user chat
sessions.
- *
- * @param contact reference to the contact whose support for chat
rooms
- * we are currently querying.
- * @return a boolean indicating whether <tt>contact</tt> supports
chatrooms.
- */
- public boolean isMultiChatSupportedByContact(Contact contact);
+
ChatRoomInvitationRejectionListener listener);
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,25 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomLocalUserParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in our
participation in the
+ * source soom has occured. Changes may include us being kicked,
join, left.
+ */
+ public void
localUserParticipationChanged(ChatRoomLocalUserParticipationChangeEvent

evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room
is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that
contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void
invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,28 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy StÔŅĹphane
+ */
+public interface ChatRoomLocalUserRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,112 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.EventObject;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our
paticipation in the
+ * source room has occured. Changes may include us being kicked,
join, left...
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomLocalUserParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserParticipationChangeEvent(ChatRoom sourceRoom,
+
String eventType,
+
String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,131 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in the
participation of the
+ * source room participant has changed. Changes may include the
participant
+ * being kicked, join, left...
+ *
+ * @author Emil Ivov
+ */
+public class ChatRoomMemberParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomMemberParticipationChangeEvent(ChatRoom
sourceRoom,
+ ChatRoomMember sourceMember,
+ String eventType,
+ String reason )
+ {
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getChatRoomMember()
+ {
+ return sourceMember;
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomMemberEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom().toString()
+ + " member="
+ + getChatRoomMember().toString()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which
was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by
us.
+ *
+ * @param evt the instance of the
<tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the
participation of the chat
+ * member in a particular chat room, such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomMemberParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the
participation of the
+ * source room member has changed. Changes may include the
participant
+ * being kicked, join, left.
+ */
+ public void
memberParticipationChanged(ChatRoomMemberParticipationChangeEvent evt );
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a
rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is
no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt>
representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,77 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomLocalUserRoleChangeEvent
+ extends EventObject
+{
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
+ {
+ super(sourceRoom);
+ this.previousRole = previousRole;
+ this.newRole = newRole;
+ }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing
reception of the
+ * <tt>source</tt> invitation received from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/ChatRoomState.java

RCS file:
src/net/java/sip/communicator/service/protocol/ChatRoomState.java
diff -N src/net/java/sip/communicator/service/protocol/ChatRoomState.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/ChatRoomState.java 1
Jan 1970 00:00:00 -0000
@@ -0,0 +1,589 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+/**
+ * The ChatRoomState class reflects the current state of a chat room.
+ *
+ * @author StÔŅĹphane Remy
+ */
+public class ChatRoomState
+{
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_VISIBLE state.
+ * <p>
+ * This constant has the String value "Visible".
+ */
+ public static final String _CHATROOM_VISIBLE = "Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_VISIBLE = new
ChatRoomState(_CHATROOM_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Not Visible".
+ */
+ public static final String _CHATROOM_NOT_VISIBLE = "Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_VISIBLE = new
ChatRoomState(_CHATROOM_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Required".
+ */
+ public static final String _CHATROOM_PASSWORD_REQUIRED = "Password
Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_REQUIRED = new
ChatRoomState(_CHATROOM_PASSWORD_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Not Required".
+ */
+ public static final String _CHATROOM_PASSWORD_NOT_REQUIRED =
"Password Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_NOT_REQUIRED =
new ChatRoomState(_CHATROOM_PASSWORD_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Required".
+ */
+ public static final String _CHATROOM_INVITATION_REQUIRED =
"Invitation Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUIRED =
new
ChatRoomState(_CHATROOM_INVITATION_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Not Required".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_REQUIRED =
"Invitation Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_REQUIRED

new ChatRoomState(_CHATROOM_INVITATION_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_LIMITED = "User
Number Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_LIMITED =
new
ChatRoomState(_CHATROOM_USER_NUMBER_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Not Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_NOT_LIMITED =
"User
Number Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_NOT_LIMITED

new ChatRoomState(_CHATROOM_USER_NUMBER_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MUTE state.
+ * <p>
+ * This constant has the String value "Mute".
+ */
+ public static final String _CHATROOM_MUTE = "Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * mute state no messages are get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_MUTE = new
ChatRoomState(_CHATROOM_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_MUTE state.
+ * <p>
+ * This constant has the String value "Not Mute".
+ */
+ public static final String _CHATROOM_NOT_MUTE = "Not Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * mute state messages can be get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_NOT_MUTE = new
ChatRoomState(_CHATROOM_NOT_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_ALLOWED =
"External Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * external messages allowed state, this chat room can receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Not
Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED

"External Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * external messages allowed state, this chat room can not receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_REGISTERED state.
+ * <p>
+ * This constant has the String value "Registered".
+ */
+ public static final String _CHATROOM_REGISTERED = "Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_REGISTERED = new
ChatRoomState(_CHATROOM_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Not Registered".
+ */
+ public static final String _CHATROOM_NOT_REGISTERED = "Not
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_REGISTERED = new
ChatRoomState(_CHATROOM_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Locked".
+ */
+ public static final String _CHATROOM_SUBJECT_LOCKED = "Subject
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * subject locked state, only admin users can change the subject
of
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_LOCKED = new
ChatRoomState(_CHATROOM_SUBJECT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Not locked".
+ */
+ public static final String _CHATROOM_SUBJECT_NOT_LOCKED = "Subject
Not locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * subject locked state, all users can change the subject of this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_NOT_LOCKED =
new
ChatRoomState(_CHATROOM_SUBJECT_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_ALLOWED =
"Message Format Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format allowed, all colored, underlined... messages are
allowed.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_ALLOWED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Not Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED =
"Message Format Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format not allowed, all colored, underlined... messages
are not allowed.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_FILTERED =
"Message Format Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format filtered state, all colored, underlined...
messages are seen in standard format
+ * by other users.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_FILTERED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Not Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_FILTERED =
"Message Format Not Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * message format filtered state, all colored, underlined...
messages are seen
+ * by other users.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_LIMITED = "Join
Time
Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * join time limited state, users can only join in an interval of
X time.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_LIMITED = new
ChatRoomState(_CHATROOM_JOIN_TIME_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Not Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_NOT_LIMITED = "Join
Time Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * join time limited state.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_NOT_LIMITED =
new ChatRoomState(_CHATROOM_JOIN_TIME_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_REQUEST_ALLOWED =
"Invitation Request Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation request allowed state, all invitation request are
allowed.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Not
Allowed".
+ */
+ public static final String
_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED
= "Invitation Request Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation request allowed state, all invitation request are
rejected.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Redirected".
+ */
+ public static final String _CHATROOM_USER_REDIRECTED = "User
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * user redirected state, all users which join this chat room are
redirected to an other one.
+ */
+ public static final ChatRoomState CHATROOM_USER_REDIRECTED = new
ChatRoomState(_CHATROOM_USER_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NOT_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Not Redirected".
+ */
+ public static final String _CHATROOM_USER_NOT_REDIRECTED = "User
Not
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * user redirected state, all users which join this chat room are
not redirected.
+ */
+ public static final ChatRoomState CHATROOM_USER_NOT_REDIRECTED =
new
ChatRoomState(_CHATROOM_USER_NOT_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_LOCKED = "Nicknames
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nicknames locked state, users in this chat room can not change
their nickname.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_LOCKED = new
ChatRoomState(_CHATROOM_NICKNAMES_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Not Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_NOT_LOCKED =
"Nicknames Not Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nicknames locked state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_NOT_LOCKED =
new ChatRoomState(_CHATROOM_NICKNAMES_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Locked".
+ */
+ public static final String _CHATROOM_KICK_LOCKED = "Kick Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * kick locked state, kicks are locked on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_KICK_LOCKED = new
ChatRoomState(_CHATROOM_KICK_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Not Locked".
+ */
+ public static final String _CHATROOM_KICK_NOT_LOCKED = "Kick Not
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * kick locked state.
+ */
+ public static final ChatRoomState CHATROOM_KICK_NOT_LOCKED = new
ChatRoomState(_CHATROOM_KICK_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Registered".
+ */
+ public static final String _CHATROOM_USERS_REGISTERED = "Users
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * users registered state, only registered users can join this
room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_REGISTERED = new
ChatRoomState(_CHATROOM_USERS_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Not Registered".
+ */
+ public static final String _CHATROOM_USERS_NOT_REGISTERED = "Users
Not Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * users registered state, all users can join this chat room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_NOT_REGISTERED =
new ChatRoomState(_CHATROOM_USERS_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_ALLOWED =
"Special Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * special messages allowed state.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Not Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED

"Special Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * special messages allowed state, only a specific level type of
message are allowed.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_VISIBLE =
"Nickname List Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAME_LIST_VISIBLE =
new ChatRoomState(_CHATROOM_NICKNAME_LIST_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Not Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_NOT_VISIBLE =
"Nickname List Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState
CHATROOM_NICKNAME_LIST_NOT_VISIBLE
= new ChatRoomState(_CHATROOM_NICKNAME_LIST_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_ALLOWED =
"Invitation Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * invitation allowed state, users can invite other users in this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_ALLOWED =
new
ChatRoomState(_CHATROOM_INVITATION_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Not Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_ALLOWED =
"Invitation Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * invitation allowed state, users can not invite other users in
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_ALLOWED

new ChatRoomState(_CHATROOM_INVITATION_NOT_ALLOWED);
+
+ /**
+ * A string representation of this Chat Room State.
+ */
+ private String chatRoomStateStr;
+
+ /**
+ * Create a chat room state object with a value corresponding to
the specified
+ * string.
+ * @param chatRoomState a string representation of the state.
+ */
+ private ChatRoomState(String chatRoomState)
+ {
+ this.chatRoomStateStr = chatRoomState;
+ }
+
+ /**
+ * Returns a String representation of that chat room State.
+ *
+ * @return a string value (one of the _CHATROOM_XXX constants)
representing
+ * this chat room state).
+ */
+ public String getStateString()
+ {
+ return chatRoomStateStr;
+ }
+
+ /**
+ * Returns a string represenation of this call state. Strings
returned
+ * by this method have the following format:
+ * "ChatRoomState:<STATE_STRING>" and are meant to be used for
loggin/debugging
+ * purposes.
+ * @return a string representation of this object.
+ */
+ public String toString()
+ {
+ return getClass().getName()+":"+getStateString();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy StÔŅĹphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

StÔŅĹphane Remy wrote:

Hello,

Emil, Yana

I've changed some of the services and events, related to the chat
rooms, all i've changed isn't already implemented for irc but i
want you to take a look and tell me if you are ok with what i've
done and maybe add it to sc :).

And if someone else has an idee about changes, additions to do
about multi user chat you are welcome on this thread :wink:

StÔŅĹphane

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java ---
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22
Feb 2007 12:37:47 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationRejectedEvent
- extends EventObject
-{
- public InvitationRejectedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22
Feb 2007 12:37:18 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -7,6 +7,7 @@
package net.java.sip.communicator.service.protocol.event;

import java.util.*;
+import net.java.sip.communicator.service.protocol.*;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property

of

@@ -14,14 +15,159 @@
* The event contains references to the source chat room and
provider, the name
* of the property that has just changed as well as its old and new

values.

*
- * @author Emil Ivov
+ * @author StÔŅĹphane Remy
*/
public class ChatRoomPropertyChangeEvent
   extends EventObject
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room topic being changed, that means the subject of
this channel
+ * has changed
+ */
+ public static final String TOPIC_CHANGED = "TopicChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode private, that means the channel
is now no more
+ * visible in the list of channels
+ */
+ public static final String MODE_PRIVATE = "ModePrivate";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode secret, that means the channel
is now no more
+ * visible in the list of channels and no one can make a
request on this channel
+ * in order to see if it exists like in irc a whois on a
channel if it is in mode
+ * secret don't response.
+ */
+ public static final String MODE_SECRET = "ModeSecret";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode invite only, that means the
channel can only
+ * be joined by invited members.
+ */
+ public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode topic protected, that means the
channel topic can only
+ * be changed by operators.
+ */
+ public static final String MODE_TOPIC_PROTECTED =

"ModeTopicProtected";

+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode chat room message only, that
means the channel can only receive
+ * messages from a user that is on this channel.
+ */
+ public static final String MODE_CHAT_ROOM_MESSAGE_ONLY =
"ModeChatRoomMessageOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode moderated, that means only user
that have
+ * enough level in this room can send messages.
+ */
+ public static final String MODE_MODERATED = "ModeModerated";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode max user, that means only a max
number of
+ * members can join this chat room.
+ */
+ public static final String MODE_MAX_USER = "ModeMaxUser";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode key, that means that all members

need

+ * a key to join this channel.
+ */
+ public static final String MODE_KEY = "ModeKey";
+
+ /**
+ * The type of this event. Values can be any of the above fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible content of the event
+ * that have occurred, like if a key is set, or a max user

number...

+ */
+ private String content = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String content,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.content = content;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the above
+ * field values.
+ *
+ * @return one of the field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * A reason string indicating the content of this event.
+ *
+ * @return a human readable String containing the content for
this event,
+ * or null if no particular content was specified.
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
   {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
   }

}
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java ---
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java 22 Feb 2007 12:37:33 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * A listener that is fired anytime an invitation to join a MUC
room is received.
- *
- * @author Emil Ivov
- */
-public interface InvitationListener
-{
- /**
- * Called when we receive an invitation to join an existing

ChatRoom.

- * <p>
- * @param evt the <tt>InvitationReceivedEvent</tt> that
contains the newly
- * received invitation and its source provider.
- */
- public abstract void invitationReceived(InvitationReceivedEvent

evt);

-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23
Apr 2007 18:11:36 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role

in the

+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author StÔŅĹphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
   extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole

previousRole,

+ ChatRoomMemberRole newRole)
   {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
   }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is
pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -6,18 +6,109 @@
*/
package net.java.sip.communicator.service.protocol.event;

+import java.util.EventObject;
+
+import net.java.sip.communicator.service.protocol.*;
+
/**
* Dispatched to notify interested parties that a change in our
status in the
* source room has changed. Changes may include us being kicked,

banned, or

* granted admin permissions.
*
* @author Emil Ivov
+ * @author StÔŅĹphane Remy
*/
public class ChatRoomLocalUserStatusChangeEvent
+ extends EventObject
{
- public ChatRoomLocalUserStatusChangeEvent()
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the
MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
   {
- super();
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
   }

+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values
indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/event...

[Message clipped]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#9

Hi Yana

Yana Stamcheva <yana@sip-communicator.org> a écrit :

Hi Stéphane,

I understand what is bothering you. When I started renaming the fields
as you proposed I couldn't get rid of the idea that all these are
actually properties of the chat room. Finally after an off-list
discussion with Emil we've decided to make all known configuration
params - properties in the chat room and to have a method that allows
to add advanced configuration properties by specifying a property name
and value. You could have a look at the ChatRoom interface and see how
it looks after the modifications.

Yep, i've undersand that if that was your question :slight_smile:

I have some doubts about some of the properties and I would like to ask
you to have a more detailed look at the following methods:

- isAllowInvitationSend, isAllowInvitationReceive (respectively the set
methods) - these methods correspond the following params:
CHATROOM_INVITATION_ALLOWED, CHATROOM_INVITATION_REQUEST_ALLOWED. The
names of the properties were a little confusing (the direction of the
invitation is not clear) and I've tried to make them more
understandable, but I'm not sure if I understand correctly their
meaning. Also if you have another suggestion for the name if you don't
like that?

I would modify the isAllowInvitationSend into isInvitationAllowed because the CHATROOM_INVITATION_ALLOWED means that you can invite someone on a chatroom but i meant in my previous mail that it is better to put this into CHATROOM_INVITATION_REFUSED because by default invitation are allowed so it is easier for me to put in a list of configs what is not allowed than all the configs that are allowed.

For CHATROOM_INVITATION_REQUEST_ALLOWED that means when you are not on a chatroom and you need an invitation to get into it you can ask someone which is in the chatroom to invite you by sending a request on this chatroom. By default is this allowed for IRC. So i would put a method isInvitationDemandAllowed or isInvitationRequestAllowed.

- isAllowMessageFormatting, isFilterMessageFormatting - these two
correspond to CHATROOM_MESSAGE_FORMAT_ALLOWED,
CHATROOM_MESSAGE_FORMAT_FILTERED. Is it possible to be in a message
format allowed mode and to have formatted messages filtered?

CHATROOM_MESSAGE_FORMAT_ALLOWED means that when you write a message with color, underlined etc... the message will be send on the chatroom so if this mode is not set the server will destroy the message and it will never be displayed.

CHATROOM_MESSAGE_FORMAT_FILTERED means that when you write a message with color, underlined etc... the message will be send on the chatroom but without any color or underline, it will be black.

So it is possible to have a format allowed mode and to have a filtered mode at the same time.

I will try to explain what was the aim of my previous mail, for example when you join an irc chat room this mode can be set +tnr, that means:

t: the subject is locked
n: you must be on this chat room to write a message (you cannot be only on the server and send /msg #channel message)
r: this room is registered with the Chanserv service

So i meant that the irc protocol gives me a string with all the config that are set on this chatroom so it is easier for me if the chat room services config match with this, but that's only to make me the life easier :slight_smile: but if you don't want to change them i can make a list of all the configs allowed each time and filter with what this string says...

And if you wanna more informations about the irc modes here is a link:

http://wiki.sur-la-toile.com/Mode_IRC

That's all.

Also, any comments and corrections are appreciated:))

I hope that all i've said is clear enough otherwise don't hesitate to say that my english is bad :stuck_out_tongue: And of course if you have an other question don't hesitate to ask.

Ah and i have seen that a service is missing or i've not found it for the chat room members statut, for example when a member change his nickname or is set in away mode there are no events, i will see if i find something...

Yana

Stéphane

···

Stéphane Remy wrote:

Hi Yana,

I've found other problems in the services, can you changes this in ChatRoomConfigParam:

-Change CHAT_ROOM_EXTERNAL_MESSAGE_ALLOWED into CHAT_ROOM_EXTERNAL_MESSAGE_REFUSED

-Change CHAT_ROOM_VISIBLE into CHAT_ROOM_INVISIBLE

-Change CHAT_ROOM_SPECIAL_MESSAGES_ALLOWED into CHAT_ROOM_SPECIAL_MESSAGES_REFUSED

-Change CHAT_ROOM_NICKNAME_LIST_VISIBLE into CHAT_ROOM_NICKNAME_LIST_INVISIBLE

-Change CHAT_ROOM_INVITATION_ALLOWED into CHAT_ROOM_INVITATION_REFUSED

-Change CHAT_ROOM_MESSAGE_FORMAT_ALLOWED into CHAT_ROOM_MESSAGE_FORMAT_BLOCKED

-Change CHAT_ROOM_INVITATION_REQUEST_ALLOWED into CHAT_ROOM_INVITATION_REQUEST_REFUSED

This changes are because by default they are allowed or visible.

Thanks Yana

Stéphane

Yana Stamcheva <yana@sip-communicator.org> a écrit :

Hi Stephane,

thanks for the remarks! I've just applied your fixes and committed them
to the CVS.

Yana

Stéphane Remy wrote:

Hi Yana,

Sorry for the late answer. I updated my code with your changes and i'm ok with all you've done. I just noticed two things you forgot to change:

In ChatRoomPropertyChangeEvent:

You forgot to change PROPERTY_STATE_CHANGED into PROPERTY_CONFIG_CHANGED.

In ChatRoomConfigParam:

You forgot to remove _CHAT_ROOM_NOT_VISIBLE.

Stéphane

Yana Stamcheva <yana@sip-communicator.org> a écrit :

Hi Stephane,

very well structured and complete code! You've done a very good work!

I have just committed your code to the cvs. I had to make some minor
modifications so the code fit better to SIP Communicator conventions, you
could see the list of changes below.

General modifications

- Removed special characters from author name - Stéphane was renamed to
Stephane

- Added additional comments where needed

- Renamed
- ChatRoomLocalUserParticipationChangeEvent to
ChatRoomLocalUserPresenceChangeEvent
- ChatRoomLocalUserParticipationListener to
ChatRoomLocalUserPresenceListener -
- ChatRoomMemberParticipationChangeEvent to
ChatRoomMemberPresenceChangeEvent
- ChatRoomMemberParticipationListener to ChatRoomMemberPresenceListener

After a discussion with Emil we decided to take the "Presence" name, it
appears more intuitive

ChatRoom

- Added some additional comments to setUserLimit, addBanMask, removeBanMask,
getBanList, getUserLimit - to explain some more details on what ban mask or
ban list is, what is the user limit about, etc.

- Renamed setState to addConfigParam - we renamed also the ChatRoomState
class to ChatRoomConfigParam. I had a look in the ChatRoomState class and I
would say that properties there are rather configuration patameters and not
chat room states.

- Added removeConfigParam, getSupportedConfigurationParams and
getConfiguration - in order to be able to remove a configuration parameter,
to obtain the list of configuration paramaters supported by the current
implementation and to obtain the current chat room configuration.

- Added getPassword method - it was only a setPassword.

- Removed final modifiers for String and int parameters - Java API says that
"Strings are constant; their values cannot be changed after they are
created" . And ints are not objects and they're copied by value (i.e. a
brand new copy is created and is passed to the method), so the final
modifier is redundant in this case.

ChatRoomState

- Renamed to ChatRoomConfigParam - as I already mentioned the name wasn't
very well fitting the content of the class, so we tried to make it more
intuitive

- Formatted the code - lines were longer than 80 columns

- Added additional comments

- Removed CHAT_ROOM_PASSWORD_NOT_REQUIRED, CHATROOM_INVITATION_NOT_REQUIRED,
CHATROOM_USER_NUMBER_NOT_LIMITED, CHATROOM_NOT_MUTE,
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED, CHATROOM_NOT_REGISTERED,
CHATROOM_SUBJECT_NOT_LOCKED, CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED,
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED, CHATROOM_JOIN_TIME_NOT_LIMITED, etc.

- Renamed CHAT_ROOM_USER_REGISTERED to CHAT_ROOM_ONLY_REGISTERED_USER - I
think it's more intuitive this way

- All _XXX String constants are changed to protected - they will be used
only internaly and may be by descendants

ChatRoomInvitation

- get back the name of the author of the class - should not remove the name
of the author even if the class was almost empty and we wrote the whole
implementation:)

ChatRoomPropertyChangeEvent

- get back the name of the author of the class:)

- Removed the getProtocolProvider method - the protocol provider could be
obtained from the chat room and has nothing to do in the context of this
event

- Removed the reason field - I don't think we need to have the String
reason, I don't really see for what it could be used.

- Added getOldValue and getNewValue methods - in order to be able to obtain
previous and new property values

That's all for now.

Thanks again Stephane and Loic for the great work! I'll continue with the
irc implementation now and soon we'll have all your work on cvs.

If you have any remarks on above changes you're welcome to express yourself.

Regards,
Yana

On 5/21/07, Stéphane Remy <stephane.remy@ulp.u-strasbg.fr> wrote:

Hi Yana,

I have made a lot of changes again to this services, i hope i didn't
forget something, otherwise don't hesitate to tell it to me i will
fixe it.

Quoting Yana Stamcheva <yana@sip-communicator.org>:

Hi Stephane,

Sorry for the late response. You have done really good work here. Bravo!

I would propose just some minor changes to discuss:
- In ChatRoomMemberRoleListener we should called the method
memberRoleChanged, instead of memberStatusChanged. (I think it's a copy
paste error)

I have changed that.

- In ChatRoomInvitatioXXXEvent we should rename the method
getSourceMessage to getSourceInvitation or getChatRoomInvitation,
because actually it returns a ChatRoomInvitation.

It's fixed too.

- After a discussion with Emil we think that it would be correct that
ChatRoomPropertyChangeEvent extends java.beans.PropertyChangeEvent and
thus it should implement getOldValue and getNewValue methods.

For this part i have made a lot of changes, i have used the
java.beans.PropertyChangeEvent, but i have also created a class name
ChatRoomState which contains all the possible states for a chat room.

- We have some doubts for the name TOPIC_CHANGED. In the ChatRoom we
already have a property called "subject", so may be it's better to call
it SUBJECT_CHANGED here also.

It's fixed too.

- In fact all the names of properties in the
ChatRoomPropertyChangeEvent are not very well matching the convention
used for property names. We should change them may be by replacing MODE
with PROPERTY and further more by adjusting better the names so that
they are more intuitive.

I have made them as intuitive as possible this time, but if you find
better words to make them more intuitive just tell me.

- And finally all properties defined in the ChatRoomPropertyChangeEvent
should also exist as properties in the ChatRoom, because they are
actually properties of the chat room and we should be able to get and
set their value from there.

I have changed this too.

That's all for now. May be Emil will have something to add.

I should say one more time congratulations for the work :slight_smile:

Yana

Fot the ChatRoomState class i'm not sure if it is the best way to do,
so tell me what do you think about it.

Stéphane

here is the patch:

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * Dispatched to notify interested parties that a change in our status in
the
- * source room has changed. Changes may include us being kicked, banned,
or
- * granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomLocalUserStatusChangeEvent
-{
- public ChatRoomLocalUserStatusChangeEvent()
- {
- super();
- }
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberListener.java 23
Apr 2007 18:11:29
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in the status of the
chat
- * participants in a particular chat room, such as us being kicked,
banned, or
- * granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomMemberListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- */
- public void memberStatusChanged( ChatRoomMemberEvent evt );
-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22 Feb 2007 12:37:18
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 21 May 2007 07:05:35
-0000
@@ -6,22 +6,114 @@
*/
package net.java.sip.communicator.service.protocol.event;

-import java.util.*;
+import net.java.sip.communicator.service.protocol.ChatRoom;
+import net.java.sip.communicator.service.protocol.ProtocolProviderService
;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property
of
- * the corresponding chat room (e.g. its subject or type) have been
modified.
+ * the corresponding chat room (e.g. its subject or state) have been
modified.
* The event contains references to the source chat room and
provider, the name
* of the property that has just changed as well as its old and new
values.
*
- * @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomPropertyChangeEvent
- extends EventObject
+ extends java.beans.PropertyChangeEvent
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room subject being changed.
+ */
+ public static final String PROPERTY_SUBJECT_CHANGED =
"SubjectChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room ban list being changed.
+ */
+ public static final String PROPERTY_BAN_LIST_CHANGED =
"BanListChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room user limit being changed.
+ */
+ public static final String PROPERTY_USER_LIMIT_CHANGED =
"UserLimitChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room state changed.
+ */
+ public static final String PROPERTY_STATE_CHANGED = "StateChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * chat room password being changed.
+ */
+ public static final String PROPERTY_PASSWORD_CHANGED =
"PasswordChanged";
+
+ /**
+ * An optional String indicating a possible reason why the event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom source,
+ String
propertyName,
+ Object oldValue,
+ Object newValue,
+ String reason)
+ {
+ super(source, propertyName, oldValue, newValue);
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with this
+ * event.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns a reference to the protocol provider where the event has
+ * originated.
+ * <p>
+ * @return a reference to the ProtocolProviderService instance where
this
+ * event originated.
+ */
+ public ProtocolProviderService getProtocolProvider()
+ {
+ return getSourceChatRoom().getParentProvider();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
   {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + this.getPropertyName()
+ + " sourceRoom="
+ + this.getSource().toString()
+ + "oldValue="
+ + this.getOldValue().toString()
+ + "newValue="
+ + this.getNewValue().toString()
+ + "]";
   }

}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberEvent.java 23 Apr 2007 18:11:22
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,124 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-import net.java.sip.communicator.service.protocol.*;
-
-/**
- * Dispatched to notify interested parties that a change in the status of
the
- * source room participant has changed. Changes may include the
participant
- * being kicked, banned, or granted admin permissions.
- *
- * @author Emil Ivov
- */
-public class ChatRoomMemberEvent
- extends EventObject
-{
- /**
- * Indicates that this event was triggered as a result of the source
- * participant joining the source chat room.
- */
- public static final String MEMBER_JOINED = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant being "kicked" out of the chat room.
- */
- public static final String MEMBER_LEFT = "MemberJoined";
-
- /**
- * Indicates that this event was triggered as a result of the source
- * participant leaving the source chat room.
- */
- public static final String MEMBER_KICKED = "MemberKicked";
-
- /**
- * The member that the event relates to.
- */
- private ChatRoomMember sourceMember = null;
-
- /**
- * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
- */
- private String eventType = null;
-
- /**
- * An optional String indicating a possible reason as to why the
event
- * might have occurred.
- */
- private String reason = null;
-
- public ChatRoomMemberEvent(ChatRoom sourceRoom,
- ChatRoomMember sourceMember,
- String eventType,
- String reason )
- {
- super(sourceRoom);
- this.sourceMember = sourceMember;
- this.eventType = eventType;
- this.reason = reason;
- }
-
- /**
- * Returns the source chat room for this event.
- *
- * @return the <tt>ChatRoom</tt> associated with that is the
source of this
- * event and that the corresponding ChatRoomMemberBelongs to.
- */
- public ChatRoom getChatRoom()
- {
- return (ChatRoom)getSource();
- }
-
- /**
- * Returns the member that this event is pertaining to.
- * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
- */
- public ChatRoomMember getChatRoomMember()
- {
- return sourceMember;
- }
-
- /**
- * A reason string indicating a human readable reason for this event.
- *
- * @return a human readable String containing the reason for this
event,
- * or null if no particular reason was specified.
- */
- public String getReason()
- {
- return reason;
- }
-
- /**
- * Returns the type of this event which could be one of the
MEMBER_XXX-ed
- * member field values.
- *
- * @return one of the MEMBER_XXXed member field values indicating
the type
- * of this event.
- */
- public String getEventType()
- {
- return eventType;
- }
-
- /**
- * Returns a String representation of this event.
- */
- public String toString()
- {
- return "ChatRoomMemberEvent[type="
- + getEventType()
- + " sourceRoom="
- + getChatRoom()
- + " member="
- + getChatRoomMember()
- + "]";
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java ---
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusListener.java 22 Feb 2007 12:36:09
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- * Adds a listener that will be notified of changes in our status in the
room
- * such as us being kicked, banned, or granted admin permissions.
- * @author Emil Ivov
- */
-public interface ChatRoomLocalUserStatusListener
- extends EventListener
-{
- /**
- * Called to notify interested parties that a change in our status in
the
- * source soom has changed. Changes may include us being kicked,
banned, or
- * granted admin permissions.
- */
- public void
localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt);
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23 Apr 2007 18:11:36
-0000 1.1
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 21 May 2007 07:05:35
-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
   extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMember sourceMember,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
   {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
   }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java,v retrieving revision 1.1
diff -u -r1.1 ChatRoomInvitation.java
---
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 22
Feb
2007 12:35:34 -0000 1.1
+++
src/net/java/sip/communicator/service/protocol/ChatRoomInvitation.java 21
May
2007 07:05:34 -0000
@@ -7,13 +7,42 @@
package net.java.sip.communicator.service.protocol;

/**
- * @author Emil Ivov
+ * This interface representes an invitation, which is send from a
chat room member
+ * to an other in order to invite this chat room member to join the
chat room this invitation
+ * have for target.
+ *
+ * @author Stéphane Remy
*/
-public class ChatRoomInvitation
+public interface ChatRoomInvitation
{
- public ChatRoomInvitation()
- {
- super();
- }
-
+ /**
+ * Returns the chat room target of this invitation
+ *
+ * @return the <tt>ChatRoom</tt> target of this invitation
+ */
+ public ChatRoom getTarget();
+
+ /**
+ * Returns the reason of this invitation, or null if there is no
reason
+ *
+ * @return the reason of this invitation, or null if there is no
reason
+ */
+ public String getReason();
+
+ /**
+ * Returns the subject of this invitation or null if the
invitation contains no
+ * subject.
+ * @return the subject of this invitation or null if the
invitation contains no
+ * subject.
+ */
+ public String getSubject();
+
+ /**
+ * Returns the protocol provider instance that this invitation
has originated
+ * in.
+ *
+ * @return the <tt>ProtocolProviderService</tt> instance that
created this
+ * invitation
+ */
+ public ProtocolProviderService getProtocolProvider();
}
Index:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java ---
src/net/java/sip/communicator/service/protocol/InvitationReceivedEvent.java 22
Feb 2007 12:35:41 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol;
-
-/**
- * Delivered when we receive an invitation for joining an existing chat
room.
- * If the corresponding chat room requires a password, then it could be
- * retreived by the getPassword() method. The method would return null if
no
- * password is necessary to join the specified chat room.
- *
- * @author Emil Ivov
- */
-public class InvitationReceivedEvent
- extends java.util.EventObject
-{
-
- public InvitationReceivedEvent(ProtocolProviderService srcProvider,
- ChatRoom chatRoom)
- {
- super(srcProvider);
- }
-}
Index: src/net/java/sip/communicator/service/protocol/ChatRoom.java

RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/ChatRoom.java,v retrieving revision 1.4
diff -u -r1.4 ChatRoom.java
--- src/net/java/sip/communicator/service/protocol/ChatRoom.java 24
Apr 2007 12:31:25 -0000 1.4
+++ src/net/java/sip/communicator/service/protocol/ChatRoom.java 21
May 2007 07:05:34 -0000
@@ -17,7 +17,6 @@
*/
public interface ChatRoom
{
-
   /**
    * Returns the name of this <tt>ChatRoom</tt>.
    *
@@ -95,25 +94,6 @@
   public void leave();

   /**
- * Adds <tt>listener</tt> to the list of listeners registered to
receive
- * events upon modification of chat room properties such as its
subject
- * for example.
- *
- * @param listener ChatRoomChangeListener
- */
- public void addChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
- * Removes <tt>listener</tt> from the list of listeneres current
registered
- * for chat room modification events.
- *
- * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
- */
- public void removeChatRoomPropertyChangeListener(
- ChatRoomPropertyChangeListener
listener);
-
- /**
    * Returns the last known room subject/theme or <tt>null</tt> if the
user
    * hasn't joined the room or the room does not have a subject yet.
    * <p>
@@ -163,41 +143,88 @@
      throws OperationFailedException;

  /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
   *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
   */
- public void addLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void addLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

  /**
- * Removes a listener that was being notified of changes in our status
in
- * the room such as us being kicked, banned, or granted admin
permissions.
+ * Removes a listener that was being notified of changes in our
participation in
+ * the room such as us being kicked, join, left...
   *
- * @param listener a local user status listener.
+ * @param listener a local user participation listener.
   */
- public void removeLocalUserStatusListener(
- ChatRoomLocalUserStatusListener
listener);
+ public void removeLocalUserParticipationListener(
+
ChatRoomLocalUserParticipationListener listener);

  /**
- * Adds a listener that will be notified of changes in our status
in the room
- * such as us being kicked, banned, or granted admin permissions.
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left...
   *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
   */
- public void addMemberListener(ChatRoomMemberListener listener);
+ public void
addMemberParticipationListener(ChatRoomMemberParticipationListener
listener);

  /**
- * Removes a listener that was being notified of changes in the status
of
- * other chat room participants such as users being kicked, banned, or
- * granted admin permissions.
+ * Removes a listener that was being notified of changes in the
participation of
+ * other chat room participants such as users being kicked, join,
left.
   *
- * @param listener a participant status listener.
+ * @param listener a member participation listener.
   */
- public void removeMemberListener(
- ChatRoomMemberListener listener);
-
+ public void
removeMemberParticipationListener(ChatRoomMemberParticipationListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in our role
in the room
+ * such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in our role
in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a local user role listener.
+ */
+ public void
removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener);
+
+ /**
+ * Adds a listener that will be notified of changes of a member
role in the room
+ * such as being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void addMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Removes a listener that was being notified of changes of a
member role in
+ * this chat room such as us being granded operator.
+ *
+ * @param listener a member role listener.
+ */
+ public void removeMemberRoleListener(ChatRoomMemberRoleListener
listener);
+
+ /**
+ * Adds a listener that will be notified of changes in the
property of the room
+ * such as the subject being change or the room state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
addPropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
+ /**
+ * Removes a listener that was being notified of changes in the
property of
+ * the chat room such as the subject being change or the room
state being changed.
+ *
+ * @param listener a property change listener.
+ */
+ public void
removePropertyChangeListener(ChatRoomPropertyChangeListener listener);
+
   /**
    * Invites another user to this room.
    * <p>
@@ -285,6 +312,82 @@
    */
   public ProtocolProviderService getParentProvider();

- //include - roominfo
- /** @todo include room info */
+ /**
+ * Sets the password of this chat room. If the user does not have
the right
+ * to change the room password, or the protocol does not support
this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param password the new password that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setPassword(final String password)
+ throws OperationFailedException;
+
+ /**
+ * Adds a ban mask to the list fo ban masks of this chat room. If
the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the new ban mask that we'd like to add to this
room ban list
+ * @throws OperationFailedException
+ */
+ public void addBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Remove a ban mask of the list fo ban masks of this chat room.
If the user does
+ * not have the right to change the room ban list, or the
protocol does not
+ * support this, or the operation fails for some other reason,
the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param banMask the ban mask that we'd like to remove from this
room ban list
+ * @throws OperationFailedException
+ */
+ public void removeBanMask(final String banMask)
+ throws OperationFailedException;
+
+ /**
+ * Sets the user limit of this chat room. If the user does not
have the right
+ * to change the room user limit, or the protocol does not
support this, or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param userLimit the new user limit that we'd like this room to
have
+ * @throws OperationFailedException
+ */
+ public void setUserLimit(final int userLimit)
+ throws OperationFailedException;
+
+ /**
+ * Sets a state of this chat room. If the user does not have the
right
+ * to change the room state, or the protocol does not support this,
or
+ * the operation fails for some other reason, the method throws an
+ * <tt>OperationFailedException</tt> with the corresponding code.
+ *
+ * @param state the new state that we'd like this room to have
+ * @throws OperationFailedException
+ */
+ public void setState(ChatRoomState state)
+ throws OperationFailedException;
+
+ /**
+ * Returns the list of ban mask that are currently of this chat room.
+ * @return List the ban list of this room.
+ */
+ public List getBanList();
+
+ /**
+ * Returns the list of states that this chat room is currently in.
+ * @return List the list of states of this chat room.
+ */
+ public List getStateList();
+
+ /**
+ * Returns the limit of user of this chat room, of returns -1 if
there is
+ * no limit.
+ * @return List the list of states of this chat room.
+ */
+ public int getUserLimit();
}
Index:

src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java ===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java,v retrieving revision 1.4
diff -u -r1.4 OperationSetMultiUserChat.java
---
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 23 Apr 2007 18:12:44
-0000 1.4
+++
src/net/java/sip/communicator/service/protocol/OperationSetMultiUserChat.java 21 May 2007 07:05:35
-0000
@@ -45,11 +45,11 @@
   public List getCurrentlyJoinedChatRooms();

   /**
- * Returns a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * Returns a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
    * currently active in.
    *
- * @param contact the contact whose current ChatRooms we will be
querying.
- * @return a list of the chat rooms that <tt>contact</tt> has
joined and is
+ * @param chatRoomMember the chatRoomMember whose current
ChatRooms we will be querying.
+ * @return a list of the chat rooms that <tt>chatRoomMember</tt>
has joined and is
    * currently active in.
    *
    * @throws OperationFailedException if an error occurs while trying
to
@@ -57,7 +57,7 @@
    * @throws OperationNotSupportedException if the server does not
support
    * multi user chat
    */
- public List getCurrentlyJoinedChatRooms(Contact contact)
+ public List getCurrentlyJoinedChatRooms(ChatRoomMember
chatRoomMember)
       throws OperationFailedException, OperationNotSupportedException;

   /**
@@ -110,7 +110,7 @@
    *
    * @param listener an invitation listener.
    */
- public void addInvitationListener(InvitationListener listener);
+ public void addInvitationListener(ChatRoomInvitationListener
listener);

   /**
    * Removes <tt>listener</tt> from the list of invitation listeners
@@ -118,7 +118,7 @@
    *
    * @param listener the invitation listener to remove.
    */
- public void removeInvitationListener(InvitationListener listener);
+ public void removeInvitationListener(ChatRoomInvitationListener
listener);

   /**
    * Adds a listener to invitation notifications. The listener
will be fired
@@ -127,7 +127,7 @@
    * @param listener an invitation listener.
    */
   public void addInvitationRejectionListener(
- InvitationRejectionListener
listener);
+
ChatRoomInvitationRejectionListener listener);

   /**
    * Removes <tt>listener</tt> from the list of invitation listeners
@@ -136,14 +136,5 @@
    * @param listener the invitation listener to remove.
    */
   public void removeInvitationRejectionListener(
- InvitationRejectionListener
listener);
-
- /**
- * Returns true if <tt>contact</tt> supports multi user chat
sessions.
- *
- * @param contact reference to the contact whose support for chat
rooms
- * we are currently querying.
- * @return a boolean indicating whether <tt>contact</tt> supports
chatrooms.
- */
- public boolean isMultiChatSupportedByContact(Contact contact);
+
ChatRoomInvitationRejectionListener listener);
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,25 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in our
participation in the room
+ * such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomLocalUserParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in our
participation in the
+ * source soom has occured. Changes may include us being kicked,
join, left.
+ */
+ public void
localUserParticipationChanged(ChatRoomLocalUserParticipationChangeEvent evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,24 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+/**
+ * A listener that is fired anytime an invitation to join a MUC room
is received.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationListener
+{
+ /**
+ * Called when we receive an invitation to join an existing ChatRoom.
+ * <p>
+ * @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that
contains the newly
+ * received invitation and its source provider.
+ */
+ public abstract void
invitationReceived(ChatRoomInvitationReceivedEvent evt);
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,28 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomLocalUserRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent
evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserParticipationChangeEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,112 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.EventObject;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our
paticipation in the
+ * source room has occured. Changes may include us being kicked,
join, left...
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserParticipationChangeEvent(ChatRoom sourceRoom,
+
String eventType,
+
String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomLocalUserStatusChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,131 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in the
participation of the
+ * source room participant has changed. Changes may include the
participant
+ * being kicked, join, left...
+ *
+ * @author Emil Ivov
+ */
+public class ChatRoomMemberParticipationChangeEvent
+ extends EventObject
+{
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the source
+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The type of this event. Values can be any of the MEMBER_XXX-ED
fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the
event
+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomMemberParticipationChangeEvent(ChatRoom
sourceRoom,
+ ChatRoomMember sourceMember,
+ String eventType,
+ String reason )
+ {
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.eventType = eventType;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is pertaining
to.
+ */
+ public ChatRoomMember getChatRoomMember()
+ {
+ return sourceMember;
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this event.
+ *
+ * @return a human readable String containing the reason for this
event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the
MEMBER_XXX-ed
+ * member field values.
+ *
+ * @return one of the MEMBER_XXXed member field values indicating
the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
+ {
+ return "ChatRoomMemberEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom().toString()
+ + " member="
+ + getChatRoomMember().toString()
+ + "]";
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectionListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * A listener that dispatches events notifying that an invitation which
was
+ * sent earlier has been rejected by the invitee.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomInvitationRejectionListener {
+
+ /**
+ * Called when an invitee rejects an invitation previously sent by
us.
+ *
+ * @param evt the instance of the
<tt>ChatRoomInvitationRejectedEvent</tt>
+ * containing the rejected chat room invitation as well as the source
+ * provider where this happened.
+ */
+ public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberParticipationListener.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,27 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the
participation of the chat
+ * member in a particular chat room, such as us being kicked, join, left.
+ *
+ * @author Emil Ivov
+ */
+public interface ChatRoomMemberParticipationListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the
participation of the
+ * source room member has changed. Changes may include the
participant
+ * being kicked, join, left.
+ */
+ public void
memberParticipationChanged(ChatRoomMemberParticipationChangeEvent evt );
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationRejectedEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,114 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationRejectedEvent</tt>s indicate reception of a
rejection of
+ * an invitation.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationRejectedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this rejection.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this rejection.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * The reason why this invitation is rejected or null if there is
no reason
+ */
+ private String reason = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>ChatRoomInvitationRejectedEvent</tt>
representing the rejection of the
+ * <tt>source</tt> invitation rejected from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation rejection.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation rejection.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.reason = reason;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has
send the rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of this rejection
+ * of the <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the reason why this <tt>Invitation</tt> is rejected.
+ *
+ * @return the reason why this <tt>Invitation</tt> is rejected.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the invitation that was rejected.
+ * @return the <tt>Invitation</tt> that was rejected.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserRoleChangeEvent.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,77 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * Dispatched to notify interested parties that a change in our role in
the
+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomLocalUserRoleChangeEvent
+ extends EventObject
+{
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,
+
ChatRoomMemberRole previousRole,
+
ChatRoomMemberRole newRole)
+ {
+ super(sourceRoom);
+ this.previousRole = previousRole;
+ this.newRole = newRole;
+ }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getSourceChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomInvitationReceivedEvent.java 1 Jan 1970 00:00:00
-0000
@@ -0,0 +1,97 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of
+ * an invitation to join a chat room.
+ *
+ * @author Emil Ivov
+ * @author Stéphane Remy
+ */
+public class ChatRoomInvitationReceivedEvent
+ extends EventObject
+{
+ /**
+ * The chat room member that has sent this invitation.
+ */
+ private ChatRoomMember from = null;
+
+ /**
+ * The chat room member that is the target of this invitation.
+ */
+ private ChatRoomMember to = null;
+
+ /**
+ * A timestamp indicating the exact date when the event occurred.
+ */
+ private Date timestamp = null;
+
+ /**
+ * Creates a <tt>InvitationReceivedEvent</tt> representing
reception of the
+ * <tt>source</tt> invitation received from the specified
<tt>from</tt>
+ * chat room member.
+ *
+ * @param source the <tt>Invitation</tt> whose reception this
event represents.
+ * @param from the <tt>ChatRoomMember</tt> that has sent this
invitation.
+ * @param to the <tt>ChatRoomMember</tt> that is the target of
this invitation.
+ * @param timestamp the exact date when the event ocurred.
+ */
+ public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source,
ChatRoomMember from, ChatRoomMember to, Date timestamp)
+ {
+ super(source);
+
+ this.from = from;
+ this.to = to;
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that has send
the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Returns a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ *
+ * @return a reference to the <tt>ChatRoomMember</tt> that is the
target of the
+ * <tt>Invitation</tt> whose reception this event represents.
+ */
+ public ChatRoomMember getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Returns the invitation that triggered this event
+ * @return the <tt>Invitation</tt> that triggered this event.
+ */
+ public ChatRoomInvitation getSourceInvitation()
+ {
+ return (ChatRoomInvitation)getSource();
+ }
+
+ /**
+ * A timestamp indicating the exact date when the event ocurred.
+ * @return a Date indicating when the event ocurred.
+ */
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+}
Index: src/net/java/sip/communicator/service/protocol/ChatRoomState.java

RCS file:
src/net/java/sip/communicator/service/protocol/ChatRoomState.java
diff -N src/net/java/sip/communicator/service/protocol/ChatRoomState.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/ChatRoomState.java 1
Jan 1970 00:00:00 -0000
@@ -0,0 +1,589 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+/**
+ * The ChatRoomState class reflects the current state of a chat room.
+ *
+ * @author Stéphane Remy
+ */
+public class ChatRoomState
+{
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_VISIBLE state.
+ * <p>
+ * This constant has the String value "Visible".
+ */
+ public static final String _CHATROOM_VISIBLE = "Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_VISIBLE = new
ChatRoomState(_CHATROOM_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Not Visible".
+ */
+ public static final String _CHATROOM_NOT_VISIBLE = "Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in
+ * a visible state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_VISIBLE = new
ChatRoomState(_CHATROOM_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Required".
+ */
+ public static final String _CHATROOM_PASSWORD_REQUIRED = "Password
Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_REQUIRED = new
ChatRoomState(_CHATROOM_PASSWORD_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_PASSWORD_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Password Not Required".
+ */
+ public static final String _CHATROOM_PASSWORD_NOT_REQUIRED =
"Password Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * password required state.
+ */
+ public static final ChatRoomState CHATROOM_PASSWORD_NOT_REQUIRED =
new ChatRoomState(_CHATROOM_PASSWORD_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Required".
+ */
+ public static final String _CHATROOM_INVITATION_REQUIRED =
"Invitation Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_REQUIRED =
new
ChatRoomState(_CHATROOM_INVITATION_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_REQUIRED state.
+ * <p>
+ * This constant has the String value "Invitation Not Required".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_REQUIRED =
"Invitation Not Required";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation required state.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_REQUIRED

new ChatRoomState(_CHATROOM_INVITATION_NOT_REQUIRED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_LIMITED = "User
Number Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_LIMITED =
new
ChatRoomState(_CHATROOM_USER_NUMBER_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NUMBER_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "User Number Not Limited".
+ */
+ public static final String _CHATROOM_USER_NUMBER_NOT_LIMITED =
"User
Number Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * user number limited state.
+ */
+ public static final ChatRoomState CHATROOM_USER_NUMBER_NOT_LIMITED

new ChatRoomState(_CHATROOM_USER_NUMBER_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MUTE state.
+ * <p>
+ * This constant has the String value "Mute".
+ */
+ public static final String _CHATROOM_MUTE = "Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * mute state no messages are get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_MUTE = new
ChatRoomState(_CHATROOM_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_MUTE state.
+ * <p>
+ * This constant has the String value "Not Mute".
+ */
+ public static final String _CHATROOM_NOT_MUTE = "Not Mute";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * mute state messages can be get from this chat room.
+ */
+ public static final ChatRoomState CHATROOM_NOT_MUTE = new
ChatRoomState(_CHATROOM_NOT_MUTE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_ALLOWED =
"External Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * external messages allowed state, this chat room can receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "External Messages Not
Allowed".
+ */
+ public static final String _CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED

"External Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * external messages allowed state, this chat room can not receive
messages from user which
+ * are not on this chat room.
+ */
+ public static final ChatRoomState
CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_EXTERNAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_REGISTERED state.
+ * <p>
+ * This constant has the String value "Registered".
+ */
+ public static final String _CHATROOM_REGISTERED = "Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_REGISTERED = new
ChatRoomState(_CHATROOM_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Not Registered".
+ */
+ public static final String _CHATROOM_NOT_REGISTERED = "Not
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * registered state.
+ */
+ public static final ChatRoomState CHATROOM_NOT_REGISTERED = new
ChatRoomState(_CHATROOM_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Locked".
+ */
+ public static final String _CHATROOM_SUBJECT_LOCKED = "Subject
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * subject locked state, only admin users can change the subject
of
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_LOCKED = new
ChatRoomState(_CHATROOM_SUBJECT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SUBJECT_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Subject Not locked".
+ */
+ public static final String _CHATROOM_SUBJECT_NOT_LOCKED = "Subject
Not locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * subject locked state, all users can change the subject of this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_SUBJECT_NOT_LOCKED =
new
ChatRoomState(_CHATROOM_SUBJECT_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_ALLOWED =
"Message Format Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format allowed, all colored, underlined... messages are
allowed.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_ALLOWED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Message Format Not Allowed".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED =
"Message Format Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format not allowed, all colored, underlined... messages
are not allowed.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_FILTERED =
"Message Format Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * message format filtered state, all colored, underlined...
messages are seen in standard format
+ * by other users.
+ */
+ public static final ChatRoomState CHATROOM_MESSAGE_FORMAT_FILTERED

new ChatRoomState(_CHATROOM_MESSAGE_FORMAT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_MESSAGE_FORMAT_NOT_FILTERED state.
+ * <p>
+ * This constant has the String value "Message Format Not Filtered".
+ */
+ public static final String _CHATROOM_MESSAGE_FORMAT_NOT_FILTERED =
"Message Format Not Filtered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * message format filtered state, all colored, underlined...
messages are seen
+ * by other users.
+ */
+ public static final ChatRoomState
CHATROOM_MESSAGE_FORMAT_NOT_FILTERED = new
ChatRoomState(_CHATROOM_MESSAGE_FORMAT_NOT_FILTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_LIMITED = "Join
Time
Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * join time limited state, users can only join in an interval of
X time.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_LIMITED = new
ChatRoomState(_CHATROOM_JOIN_TIME_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_JOIN_TIME_NOT_LIMITED state.
+ * <p>
+ * This constant has the String value "Join Time Not Limited".
+ */
+ public static final String _CHATROOM_JOIN_TIME_NOT_LIMITED = "Join
Time Not Limited";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * join time limited state.
+ */
+ public static final ChatRoomState CHATROOM_JOIN_TIME_NOT_LIMITED =
new ChatRoomState(_CHATROOM_JOIN_TIME_NOT_LIMITED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_REQUEST_ALLOWED =
"Invitation Request Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * invitation request allowed state, all invitation request are
allowed.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_REQUEST_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Request Not
Allowed".
+ */
+ public static final String
_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED
= "Invitation Request Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * invitation request allowed state, all invitation request are
rejected.
+ */
+ public static final ChatRoomState
CHATROOM_INVITATION_REQUEST_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_INVITATION_REQUEST_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Redirected".
+ */
+ public static final String _CHATROOM_USER_REDIRECTED = "User
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in an
+ * user redirected state, all users which join this chat room are
redirected to an other one.
+ */
+ public static final ChatRoomState CHATROOM_USER_REDIRECTED = new
ChatRoomState(_CHATROOM_USER_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USER_NOT_REDIRECTED state.
+ * <p>
+ * This constant has the String value "User Not Redirected".
+ */
+ public static final String _CHATROOM_USER_NOT_REDIRECTED = "User
Not
Redirected";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in an
+ * user redirected state, all users which join this chat room are
not redirected.
+ */
+ public static final ChatRoomState CHATROOM_USER_NOT_REDIRECTED =
new
ChatRoomState(_CHATROOM_USER_NOT_REDIRECTED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_LOCKED = "Nicknames
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nicknames locked state, users in this chat room can not change
their nickname.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_LOCKED = new
ChatRoomState(_CHATROOM_NICKNAMES_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAMES_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Nicknames Not Locked".
+ */
+ public static final String _CHATROOM_NICKNAMES_NOT_LOCKED =
"Nicknames Not Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nicknames locked state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAMES_NOT_LOCKED =
new ChatRoomState(_CHATROOM_NICKNAMES_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Locked".
+ */
+ public static final String _CHATROOM_KICK_LOCKED = "Kick Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * kick locked state, kicks are locked on this chat room.
+ */
+ public static final ChatRoomState CHATROOM_KICK_LOCKED = new
ChatRoomState(_CHATROOM_KICK_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_KICK_NOT_LOCKED state.
+ * <p>
+ * This constant has the String value "Kick Not Locked".
+ */
+ public static final String _CHATROOM_KICK_NOT_LOCKED = "Kick Not
Locked";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * kick locked state.
+ */
+ public static final ChatRoomState CHATROOM_KICK_NOT_LOCKED = new
ChatRoomState(_CHATROOM_KICK_NOT_LOCKED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Registered".
+ */
+ public static final String _CHATROOM_USERS_REGISTERED = "Users
Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * users registered state, only registered users can join this
room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_REGISTERED = new
ChatRoomState(_CHATROOM_USERS_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_USERS_NOT_REGISTERED state.
+ * <p>
+ * This constant has the String value "Users Not Registered".
+ */
+ public static final String _CHATROOM_USERS_NOT_REGISTERED = "Users
Not Registered";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * users registered state, all users can join this chat room.
+ */
+ public static final ChatRoomState CHATROOM_USERS_NOT_REGISTERED =
new ChatRoomState(_CHATROOM_USERS_NOT_REGISTERED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_ALLOWED =
"Special Messages Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * special messages allowed state.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_ALLOWED
= new ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Special Messages Not Allowed".
+ */
+ public static final String _CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED

"Special Messages Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * special messages allowed state, only a specific level type of
message are allowed.
+ */
+ public static final ChatRoomState
CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED = new
ChatRoomState(_CHATROOM_SPECIAL_MESSAGES_NOT_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_VISIBLE =
"Nickname List Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState CHATROOM_NICKNAME_LIST_VISIBLE =
new ChatRoomState(_CHATROOM_NICKNAME_LIST_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_NICKNAME_LIST_NOT_VISIBLE state.
+ * <p>
+ * This constant has the String value "Nickname List Not Visible".
+ */
+ public static final String _CHATROOM_NICKNAME_LIST_NOT_VISIBLE =
"Nickname List Not Visible";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * nickname list visible state.
+ */
+ public static final ChatRoomState
CHATROOM_NICKNAME_LIST_NOT_VISIBLE
= new ChatRoomState(_CHATROOM_NICKNAME_LIST_NOT_VISIBLE);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_ALLOWED =
"Invitation Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently in a
+ * invitation allowed state, users can invite other users in this
chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_ALLOWED =
new
ChatRoomState(_CHATROOM_INVITATION_ALLOWED);
+
+ /**
+ * This constant containing a String representation of the
+ * CHATROOM_INVITATION_NOT_ALLOWED state.
+ * <p>
+ * This constant has the String value "Invitation Not Allowed".
+ */
+ public static final String _CHATROOM_INVITATION_NOT_ALLOWED =
"Invitation Not Allowed";
+
+ /**
+ * This constant value indicates that the associated chat room is
currently not in a
+ * invitation allowed state, users can not invite other users in
this chat room.
+ */
+ public static final ChatRoomState CHATROOM_INVITATION_NOT_ALLOWED

new ChatRoomState(_CHATROOM_INVITATION_NOT_ALLOWED);
+
+ /**
+ * A string representation of this Chat Room State.
+ */
+ private String chatRoomStateStr;
+
+ /**
+ * Create a chat room state object with a value corresponding to
the specified
+ * string.
+ * @param chatRoomState a string representation of the state.
+ */
+ private ChatRoomState(String chatRoomState)
+ {
+ this.chatRoomStateStr = chatRoomState;
+ }
+
+ /**
+ * Returns a String representation of that chat room State.
+ *
+ * @return a string value (one of the _CHATROOM_XXX constants)
representing
+ * this chat room state).
+ */
+ public String getStateString()
+ {
+ return chatRoomStateStr;
+ }
+
+ /**
+ * Returns a string represenation of this call state. Strings
returned
+ * by this method have the following format:
+ * "ChatRoomState:<STATE_STRING>" and are meant to be used for
loggin/debugging
+ * purposes.
+ * @return a string representation of this object.
+ */
+ public String toString()
+ {
+ return getClass().getName()+":"+getStateString();
+ }
+}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java ===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java diff -N

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000
+++
src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleListener.java 1
Jan 1970 00:00:00
-0000
@@ -0,0 +1,29 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging
client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol.event;
+
+import java.util.*;
+
+/**
+ * Adds a listener that will be notified of changes in the role of the
chat
+ * participants in a particular chat room, such as us being granded any
of
+ * the roles you can see in ChatRoomMemberRole.
+ *
+ * @see ChatRoomMemberRole
+ *
+ * @author Remy Stéphane
+ */
+public interface ChatRoomMemberRoleListener
+ extends EventListener
+{
+ /**
+ * Called to notify interested parties that a change in the role of
the
+ * source room participant has changed.
+ */
+ public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt);
+
+}

Stéphane Remy wrote:

Hello,

Emil, Yana

I've changed some of the services and events, related to the chat
rooms, all i've changed isn't already implemented for irc but i
want you to take a look and tell me if you are ok with what i've
done and maybe add it to sc :).

And if someone else has an idee about changes, additions to do
about multi user chat you are welcome on this thread :wink:

Stéphane

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java ---
src/net/java/sip/communicator/service/protocol/event/InvitationRejectedEvent.java 22
Feb 2007 12:37:47 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-import java.util.*;
-
-/**
- *
- * @author Emil Ivov
- */
-public class InvitationRejectedEvent
- extends EventObject
-{
- public InvitationRejectedEvent(Object source)
- {
- super(source);
- }
-
- public static void main(String[] args)
- {
- }
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomPropertyChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 22
Feb 2007 12:37:18 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomPropertyChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -7,6 +7,7 @@
package net.java.sip.communicator.service.protocol.event;

import java.util.*;
+import net.java.sip.communicator.service.protocol.*;

/**
* <tt>ChatRoomChangeEvent</tt>s are fired to indicate that a property

of

@@ -14,14 +15,159 @@
* The event contains references to the source chat room and
provider, the name
* of the property that has just changed as well as its old and new

values.

*
- * @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomPropertyChangeEvent
  extends EventObject
{
- public ChatRoomPropertyChangeEvent(Object source)
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room topic being changed, that means the subject of
this channel
+ * has changed
+ */
+ public static final String TOPIC_CHANGED = "TopicChanged";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode private, that means the channel
is now no more
+ * visible in the list of channels
+ */
+ public static final String MODE_PRIVATE = "ModePrivate";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode secret, that means the channel
is now no more
+ * visible in the list of channels and no one can make a
request on this channel
+ * in order to see if it exists like in irc a whois on a
channel if it is in mode
+ * secret don't response.
+ */
+ public static final String MODE_SECRET = "ModeSecret";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode invite only, that means the
channel can only
+ * be joined by invited members.
+ */
+ public static final String MODE_INVITE_ONLY = "ModeInviteOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode topic protected, that means the
channel topic can only
+ * be changed by operators.
+ */
+ public static final String MODE_TOPIC_PROTECTED =

"ModeTopicProtected";

+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode chat room message only, that
means the channel can only receive
+ * messages from a user that is on this channel.
+ */
+ public static final String MODE_CHAT_ROOM_MESSAGE_ONLY =
"ModeChatRoomMessageOnly";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode moderated, that means only user
that have
+ * enough level in this room can send messages.
+ */
+ public static final String MODE_MODERATED = "ModeModerated";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode max user, that means only a max
number of
+ * members can join this chat room.
+ */
+ public static final String MODE_MAX_USER = "ModeMaxUser";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * chat room being set in mode key, that means that all members

need

+ * a key to join this channel.
+ */
+ public static final String MODE_KEY = "ModeKey";
+
+ /**
+ * The type of this event. Values can be any of the above fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible content of the event
+ * that have occurred, like if a key is set, or a max user

number...

+ */
+ private String content = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomPropertyChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String content,
+ String reason)
+ {
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.content = content;
+ this.reason = reason;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * A reason string indicating a human readable reason for this

event.

+ *
+ * @return a human readable String containing the reason for
this event,
+ * or null if no particular reason was specified.
+ */
+ public String getReason()
+ {
+ return reason;
+ }
+
+ /**
+ * Returns the type of this event which could be one of the above
+ * field values.
+ *
+ * @return one of the field values indicating the type
+ * of this event.
+ */
+ public String getEventType()
+ {
+ return eventType;
+ }
+
+ /**
+ * A reason string indicating the content of this event.
+ *
+ * @return a human readable String containing the content for
this event,
+ * or null if no particular content was specified.
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Returns a String representation of this event.
+ */
+ public String toString()
  {
- super(source);
+ return "ChatRoomPropertyChangeEvent[type="
+ + getEventType()
+ + " sourceRoom="
+ + getChatRoom()
+ + "]";
  }

}
Index:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java

===================================================================
RCS file:

src/net/java/sip/communicator/service/protocol/event/InvitationListener.java diff -N
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java ---
src/net/java/sip/communicator/service/protocol/event/InvitationListener.java 22 Feb 2007 12:37:33 -0000

1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.service.protocol.event;
-
-/**
- * A listener that is fired anytime an invitation to join a MUC
room is received.
- *
- * @author Emil Ivov
- */
-public interface InvitationListener
-{
- /**
- * Called when we receive an invitation to join an existing

ChatRoom.

- * <p>
- * @param evt the <tt>InvitationReceivedEvent</tt> that
contains the newly
- * received invitation and its source provider.
- */
- public abstract void invitationReceived(InvitationReceivedEvent

evt);

-
-}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomMemberRoleChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 23
Apr 2007 18:11:36 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomMemberRoleChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -1,23 +1,94 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging

client.

+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.service.protocol.event;

import java.util.*;

+import net.java.sip.communicator.service.protocol.*;
+
/**
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
- *
- * <p> </p>
+ * Dispatched to notify interested parties that a change in our role

in the

+ * source room has changed. Changes may include us being granted
admin permissions,
+ * or other permissions.
+ *
+ * @see ChatRoomMemberRole
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomMemberRoleChangeEvent
  extends EventObject
{
- public ChatRoomMemberRoleChangeEvent(Object source)
+ /**
+ * The member that the event relates to.
+ */
+ private ChatRoomMember sourceMember = null;
+
+ /**
+ * The previous role that this member had.
+ */
+ private ChatRoomMemberRole previousRole = null;
+
+ /**
+ * The new role that this member get.
+ */
+ private ChatRoomMemberRole newRole = null;
+
+ public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
+ ChatRoomMember sourceMember,
+ ChatRoomMemberRole

previousRole,

+ ChatRoomMemberRole newRole)
  {
- super(source);
+ super(sourceRoom);
+ this.sourceMember = sourceMember;
+ this.previousRole = previousRole;
+ this.newRole = newRole;
  }
+
+ /**
+ * Returns the new role given to this member.
+ *
+ * @return newRole the new role given to this member for this chat
+ * room.
+ */
+ public ChatRoomMemberRole getNewRole()
+ {
+ return newRole;
+ }
+
+ /**
+ * Returns the previous role that this member had in this
+ * chat room.
+ *
+ * @return previousRole the previous role that this member
+ * had in this chat room.
+ */
+ public ChatRoomMemberRole getPreviousRole()
+ {
+ return previousRole;
+ }
+
+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+ public ChatRoom getChatRoom()
+ {
+ return (ChatRoom)getSource();
+ }
+
+ /**
+ * Returns the member that this event is pertaining to.
+ * @return the <tt>ChatRoomMember</tt> that this event is
pertaining to.
+ */
+ public ChatRoomMember getSourceMember()
+ {
+ return sourceMember;
+ }
}
Index:

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java

===================================================================
RCS file:

/cvs/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java,v retrieving revision

1.1
diff -u -r1.1 ChatRoomLocalUserStatusChangeEvent.java
---

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 22
Feb 2007 12:36:02 -0000

1.1
+++

src/net/java/sip/communicator/service/protocol/event/ChatRoomLocalUserStatusChangeEvent.java 16
May 2007 08:35:07

-0000
@@ -6,18 +6,109 @@
*/
package net.java.sip.communicator.service.protocol.event;

+import java.util.EventObject;
+
+import net.java.sip.communicator.service.protocol.*;
+
/**
* Dispatched to notify interested parties that a change in our
status in the
* source room has changed. Changes may include us being kicked,

banned, or

* granted admin permissions.
*
* @author Emil Ivov
+ * @author Stéphane Remy
*/
public class ChatRoomLocalUserStatusChangeEvent
+ extends EventObject
{
- public ChatRoomLocalUserStatusChangeEvent()
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant joining the source chat room.
+ */
+ public static final String MEMBER_JOINED = "MemberJoined";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant being "kicked" out of the chat room.
+ */
+ public static final String MEMBER_LEFT = "MemberLeft";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant leaving the source chat room.
+ */
+ public static final String MEMBER_KICKED = "MemberKicked";
+
+ /**
+ * Indicates that this event was triggered as a result of the

source

+ * participant beein deconnected from the server brutally, or
ping timeout.
+ */
+ public static final String MEMBER_QUIT = "MemberQuit";
+
+ /**
+ * The type of this event. Values can be any of the
MEMBER_XXX-ED fields.
+ */
+ private String eventType = null;
+
+ /**
+ * An optional String indicating a possible reason as to why the

event

+ * might have occurred.
+ */
+ private String reason = null;
+
+ public ChatRoomLocalUserStatusChangeEvent(ChatRoom sourceRoom,
+ String eventType,
+ String reason)
  {
- super();
+ super(sourceRoom);
+ this.eventType = eventType;
+ this.reason = reason;
  }

+ /**
+ * Returns the source chat room for this event.
+ *
+ * @return the <tt>ChatRoom</tt> associated with that is the
source of this
+ * event and that the corresponding ChatRoomMemberBelongs to.
+ */
+