[sip-comm-dev] [NEW FEATURE]Support for IRC


#1

Hi everybody !

During the last months, we have worked on the implementation of the
IRC protocol in SIP Communicator for our 150 hours project.

The subject can be found here :
http://www.sip-communicator.org/index.php/Development/PluginIRC

With this mail we will try to convince you to integrate our work in
the main tree of SIP Communicator.

1. The irc protocol

Internet Relay Chat (IRC) is a form of real-time Internet chat which
is mainly designed for group communication in discussion forums called
channels, but also allows one-to-one communication and data transfers
via private message.

You can find additional information on IRC here :
http://en.wikipedia.org/wiki/Internet_Relay_Chat

The protocol specification (RFC) are available here :
http://tools.ietf.org/html/rfc1459

2. The irc stack

There are many java stacks available for the irc protocol but we had
to choose the good one !

So we made some tests and we chosed Pircbot because it seemed to be
the best and it is updated frequently.

But if somedays we find a better stack it will be quite simple to make
the change because of our implementation.

You will find the Pircbot Javadoc here : http://www.jibble.org/pircbot.php

3. How to get irc4sc?

If you want to try irc4sc it's very simple :

- Request an observer role for irc4sc on the javanet website :
https://irc4sc.dev.java.net/
- Get the projects sources with CVS
- Build sip-communicator
- Build and run irc4sc
- That's it !

4. The implementation

In this part we will try to explain you how we did the implementation
of the layer between the pircbot lib and the different multi user
services from SC.

First of all, you need to know that the implementation is not totally
finished (and it never will because it needs to be maintained :p). For
this first version of irc4sc we only have implemented a small part of
the IRC RFC because of the services interfaces limitations, we will
explain this later.

For now the messages irc4sc supports are :

Related to the chat room:
  -JOIN messages: to see if someone enters a room.
  -PART messages: to see if someone parts a room.
  -QUIT messages: to see if someone quits a room.
  -KICK messages: to see if someone is kicked from the room.
  -LIST messages: to see the list of chat rooms of a server.
  -PRIVMSG messages: to see if someone send a message.

Related to chat room members:
  -NAMES messages: to see the list of users on a channel.
  -NICK messages: to see a change of a user nick name.

We listed here all the messages which are already available through
the OperationSetMultiUserChat, ChatRoom, ChatRoomMember,
ChatRoomMemberRole classes methods.

We said before that we were limited by the services interfaces, we
will explain here what's the problem and why the rest of the irc
protocol isn't implemented. Fist of all you need to know that multi
user chat isn't very developed for SC so the few services that were
available for now weren't wide enough to covert all the IRC protocol
functionalities, that's why we had to stop the implementation to
improve these services ( that's what we are doing now, cf the
"ChatRoom services related mail" on this mailing list).

Once this services are finished we can implement the support of much
more functionalities from the IRC RFC. So you need to wait a little
while we search the best way to cover all multi user chat protocols
functionalities. (It's close from a final state :wink: ) .

So now we will try to explain to you the structure of our
implementation, we will not directly talk about code, it is well
documented so we prefer let you read it by yourself :slight_smile:

That's the structure of our implementation when the bundle is launched
after the irc service is registered :

    ++++++++++++ ++++++++++++++
    > member | | member |
    ++++++++++++ ++++++++++++++
             > >
+++++++++++++++ ++++++++++++++ ++++++++++++++++++++++++++

chatRoom | | chatRoom |--------| operationSetMultiUser |

+++++++++++++++ ++++++++++++++ ++++++++++++++++++++++++++
                > > >
              ++++++++++++++++++++++++ |

···

      server |--------------------

              ++++++++++++++++++++++++
                  > >
+++++++++++++++++++ |

event_manager | |

+++++++++++++++++++ |
                  > >
              +++++++++++++++++++++
              > pircbot |
              +++++++++++++++++++++

So each time we create an instance of the irc service provider we get
a stucture like this, at the beginning only a server and his event
manager whit the irc stack (pircbot) is created. After that you can
create and add chat rooms to the server through the operation set
multi user chat.

Here the server instance is used in order not to have a direct
relation from the chat rooms with the irc stack (we did this to make
it easier to switch the irc stack with another if necessary).

The event manager is used to dispatch events comming from the irc
stack and to filter them in order to separate the error messages from
the other messages.

All messages comming from the irc stack are parsed and the
informations are redirected to the different instances of the objects
which are using it and in the same time all the event listener are
notified.

5. What remains to do ?

We have implemented most of the main features of the IRC protocol but
some remains to do.

We have decided to continue to work on the project and here is a list
of features we are going to implement in the future :

- File transfert support
- DCC chat
- Add a special chatroom for the irc server

If you have any questions or suggestions feel free to contact us we
will be pleased to answer.

Loïc Kempf
Stéphane Remy

---------------------------------------------------------------------
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,

Congratulations for the good work!

I've started the process of integration of your plugin and have checkouted the code, but I don't see the service part there..Could you please check if you've committed all your work on cvs?

Yana

···

stephane.remy@ulp.u-strasbg.fr wrote:

Hi everybody !

During the last months, we have worked on the implementation of the
IRC protocol in SIP Communicator for our 150 hours project.

The subject can be found here :
http://www.sip-communicator.org/index.php/Development/PluginIRC

With this mail we will try to convince you to integrate our work in
the main tree of SIP Communicator.

1. The irc protocol

Internet Relay Chat (IRC) is a form of real-time Internet chat which
is mainly designed for group communication in discussion forums called
channels, but also allows one-to-one communication and data transfers
via private message.

You can find additional information on IRC here :
http://en.wikipedia.org/wiki/Internet_Relay_Chat

The protocol specification (RFC) are available here :
http://tools.ietf.org/html/rfc1459

2. The irc stack

There are many java stacks available for the irc protocol but we had
to choose the good one !

So we made some tests and we chosed Pircbot because it seemed to be
the best and it is updated frequently.

But if somedays we find a better stack it will be quite simple to make
the change because of our implementation.

You will find the Pircbot Javadoc here : http://www.jibble.org/pircbot.php

3. How to get irc4sc?

If you want to try irc4sc it's very simple :

- Request an observer role for irc4sc on the javanet website :
https://irc4sc.dev.java.net/
- Get the projects sources with CVS
- Build sip-communicator
- Build and run irc4sc
- That's it !

4. The implementation

In this part we will try to explain you how we did the implementation
of the layer between the pircbot lib and the different multi user
services from SC.

First of all, you need to know that the implementation is not totally
finished (and it never will because it needs to be maintained :p). For
this first version of irc4sc we only have implemented a small part of
the IRC RFC because of the services interfaces limitations, we will
explain this later.

For now the messages irc4sc supports are :

Related to the chat room:
    -JOIN messages: to see if someone enters a room.
    -PART messages: to see if someone parts a room.
    -QUIT messages: to see if someone quits a room.
    -KICK messages: to see if someone is kicked from the room.
    -LIST messages: to see the list of chat rooms of a server.
    -PRIVMSG messages: to see if someone send a message.

Related to chat room members:
    -NAMES messages: to see the list of users on a channel.
    -NICK messages: to see a change of a user nick name.

We listed here all the messages which are already available through
the OperationSetMultiUserChat, ChatRoom, ChatRoomMember,
ChatRoomMemberRole classes methods.

We said before that we were limited by the services interfaces, we
will explain here what's the problem and why the rest of the irc
protocol isn't implemented. Fist of all you need to know that multi
user chat isn't very developed for SC so the few services that were
available for now weren't wide enough to covert all the IRC protocol
functionalities, that's why we had to stop the implementation to
improve these services ( that's what we are doing now, cf the
"ChatRoom services related mail" on this mailing list).

Once this services are finished we can implement the support of much
more functionalities from the IRC RFC. So you need to wait a little
while we search the best way to cover all multi user chat protocols
functionalities. (It's close from a final state :wink: ) .

So now we will try to explain to you the structure of our
implementation, we will not directly talk about code, it is well
documented so we prefer let you read it by yourself :slight_smile:

That's the structure of our implementation when the bundle is launched
after the irc service is registered :

   ++++++++++++ ++++++++++++++
   > member | | member |
   ++++++++++++ ++++++++++++++
            > >
+++++++++++++++ ++++++++++++++ ++++++++++++++++++++++++++
> chatRoom | | chatRoom |--------| operationSetMultiUser |
+++++++++++++++ ++++++++++++++ ++++++++++++++++++++++++++
               > > >
             ++++++++++++++++++++++++ |
             > server |--------------------
             ++++++++++++++++++++++++
                 > >
+++++++++++++++++++ |
> event_manager | |
+++++++++++++++++++ |
                 > >
             +++++++++++++++++++++
             > pircbot |
             +++++++++++++++++++++

So each time we create an instance of the irc service provider we get
a stucture like this, at the beginning only a server and his event
manager whit the irc stack (pircbot) is created. After that you can
create and add chat rooms to the server through the operation set
multi user chat.

Here the server instance is used in order not to have a direct
relation from the chat rooms with the irc stack (we did this to make
it easier to switch the irc stack with another if necessary).

The event manager is used to dispatch events comming from the irc
stack and to filter them in order to separate the error messages from
the other messages.

All messages comming from the irc stack are parsed and the
informations are redirected to the different instances of the objects
which are using it and in the same time all the event listener are
notified.

5. What remains to do ?

We have implemented most of the main features of the IRC protocol but
some remains to do.

We have decided to continue to work on the project and here is a list
of features we are going to implement in the future :

- File transfert support
- DCC chat
- Add a special chatroom for the irc server

If you have any questions or suggestions feel free to contact us we
will be pleased to answer.

Lo�c Kempf
St�phane Remy

---------------------------------------------------------------------
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 didn't put all our work on the cvs because i use some services i made myself and i waited you and Emil to approve this services (cf Chat room related services... mail) but as you asked now i have put the version i used for the presentation on the cvs, to make this version work you need to apply the patch i put in enclusure to this mail on the directory sip-communicator, this patch contains a lot of changes:
Changes about the services, the same as i put in the previous mail.
Changes about the GUI, in order to make work the GUI, i fixed temporarity the bug of the multiple lines, and i added a leave button in order to be able to leave a chat room properly and i changed a bit the window to show the chat room list, to make it work when you connect to a server just send /list to the server in a chat window and the list will be updated so you can see the list in this window.

If you have any question don't hesitate to ask me!

Stéphane

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

patch_sc_chatroom_services_version3.txt (109 KB)

···

Hi Stephane,

Congratulations for the good work!

I've started the process of integration of your plugin and have
checkouted the code, but I don't see the service part there..Could you
please check if you've committed all your work on cvs?

Yana

stephane.remy@ulp.u-strasbg.fr wrote:

Hi everybody !

During the last months, we have worked on the implementation of the
IRC protocol in SIP Communicator for our 150 hours project.

The subject can be found here :
http://www.sip-communicator.org/index.php/Development/PluginIRC

With this mail we will try to convince you to integrate our work in
the main tree of SIP Communicator.

1. The irc protocol

Internet Relay Chat (IRC) is a form of real-time Internet chat which
is mainly designed for group communication in discussion forums called
channels, but also allows one-to-one communication and data transfers
via private message.

You can find additional information on IRC here :
http://en.wikipedia.org/wiki/Internet_Relay_Chat

The protocol specification (RFC) are available here :
http://tools.ietf.org/html/rfc1459

2. The irc stack

There are many java stacks available for the irc protocol but we had
to choose the good one !

So we made some tests and we chosed Pircbot because it seemed to be
the best and it is updated frequently.

But if somedays we find a better stack it will be quite simple to make
the change because of our implementation.

You will find the Pircbot Javadoc here : http://www.jibble.org/pircbot.php

3. How to get irc4sc?

If you want to try irc4sc it's very simple :

- Request an observer role for irc4sc on the javanet website :
https://irc4sc.dev.java.net/
- Get the projects sources with CVS
- Build sip-communicator
- Build and run irc4sc
- That's it !

4. The implementation

In this part we will try to explain you how we did the implementation
of the layer between the pircbot lib and the different multi user
services from SC.

First of all, you need to know that the implementation is not totally
finished (and it never will because it needs to be maintained :p). For
this first version of irc4sc we only have implemented a small part of
the IRC RFC because of the services interfaces limitations, we will
explain this later.

For now the messages irc4sc supports are :

Related to the chat room:
   -JOIN messages: to see if someone enters a room.
   -PART messages: to see if someone parts a room.
   -QUIT messages: to see if someone quits a room.
   -KICK messages: to see if someone is kicked from the room.
   -LIST messages: to see the list of chat rooms of a server.
   -PRIVMSG messages: to see if someone send a message.

Related to chat room members:
   -NAMES messages: to see the list of users on a channel.
   -NICK messages: to see a change of a user nick name.

We listed here all the messages which are already available through
the OperationSetMultiUserChat, ChatRoom, ChatRoomMember,
ChatRoomMemberRole classes methods.

We said before that we were limited by the services interfaces, we
will explain here what's the problem and why the rest of the irc
protocol isn't implemented. Fist of all you need to know that multi
user chat isn't very developed for SC so the few services that were
available for now weren't wide enough to covert all the IRC protocol
functionalities, that's why we had to stop the implementation to
improve these services ( that's what we are doing now, cf the
"ChatRoom services related mail" on this mailing list).

Once this services are finished we can implement the support of much
more functionalities from the IRC RFC. So you need to wait a little
while we search the best way to cover all multi user chat protocols
functionalities. (It's close from a final state :wink: ) .

So now we will try to explain to you the structure of our
implementation, we will not directly talk about code, it is well
documented so we prefer let you read it by yourself :slight_smile:

That's the structure of our implementation when the bundle is launched
after the irc service is registered :

  ++++++++++++ ++++++++++++++
  > member | | member |
  ++++++++++++ ++++++++++++++
           > >
+++++++++++++++ ++++++++++++++ ++++++++++++++++++++++++++
> chatRoom | | chatRoom |--------| operationSetMultiUser |
+++++++++++++++ ++++++++++++++ ++++++++++++++++++++++++++
              > > >
            ++++++++++++++++++++++++ |
            > server |--------------------
            ++++++++++++++++++++++++
                > >
+++++++++++++++++++ |
> event_manager | |
+++++++++++++++++++ |
                > >
            +++++++++++++++++++++
            > pircbot |
            +++++++++++++++++++++

So each time we create an instance of the irc service provider we get
a stucture like this, at the beginning only a server and his event
manager whit the irc stack (pircbot) is created. After that you can
create and add chat rooms to the server through the operation set
multi user chat.

Here the server instance is used in order not to have a direct
relation from the chat rooms with the irc stack (we did this to make
it easier to switch the irc stack with another if necessary).

The event manager is used to dispatch events comming from the irc
stack and to filter them in order to separate the error messages from
the other messages.

All messages comming from the irc stack are parsed and the
informations are redirected to the different instances of the objects
which are using it and in the same time all the event listener are
notified.

5. What remains to do ?

We have implemented most of the main features of the IRC protocol but
some remains to do.

We have decided to continue to work on the project and here is a list
of features we are going to implement in the future :

- File transfert support
- DCC chat
- Add a special chatroom for the irc server

If you have any questions or suggestions feel free to contact us we
will be pleased to answer.

Loïc Kempf
Stéphane Remy

---------------------------------------------------------------------
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!


#4

Hi Stephane,

thanks for the quick reply. Actually I was looking at your "Chat room related services mail" in order to give you feedback, but it was really uncomfortable to look at the code in the mail format, that's why I asked the source. I'll have a look now and will write to you again if I have some more questions or when I'm finished with code revision.

Thanks,
Yana

Stéphane Remy wrote:

···

HI Yana,

I didn't put all our work on the cvs because i use some services i made myself and i waited you and Emil to approve this services (cf Chat room related services... mail) but as you asked now i have put the version i used for the presentation on the cvs, to make this version work you need to apply the patch i put in enclusure to this mail on the directory sip-communicator, this patch contains a lot of changes:
Changes about the services, the same as i put in the previous mail.
Changes about the GUI, in order to make work the GUI, i fixed temporarity the bug of the multiple lines, and i added a leave button in order to be able to leave a chat room properly and i changed a bit the window to show the chat room list, to make it work when you connect to a server just send /list to the server in a chat window and the list will be updated so you can see the list in this window.

If you have any question don't hesitate to ask me!

Stéphane

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

Hi Stephane,

Congratulations for the good work!

I've started the process of integration of your plugin and have
checkouted the code, but I don't see the service part there..Could you
please check if you've committed all your work on cvs?

Yana

stephane.remy@ulp.u-strasbg.fr wrote:

Hi everybody !

During the last months, we have worked on the implementation of the
IRC protocol in SIP Communicator for our 150 hours project.

The subject can be found here :
http://www.sip-communicator.org/index.php/Development/PluginIRC

With this mail we will try to convince you to integrate our work in
the main tree of SIP Communicator.

1. The irc protocol

Internet Relay Chat (IRC) is a form of real-time Internet chat which
is mainly designed for group communication in discussion forums called
channels, but also allows one-to-one communication and data transfers
via private message.

You can find additional information on IRC here :
http://en.wikipedia.org/wiki/Internet_Relay_Chat

The protocol specification (RFC) are available here :
http://tools.ietf.org/html/rfc1459

2. The irc stack

There are many java stacks available for the irc protocol but we had
to choose the good one !

So we made some tests and we chosed Pircbot because it seemed to be
the best and it is updated frequently.

But if somedays we find a better stack it will be quite simple to make
the change because of our implementation.

You will find the Pircbot Javadoc here : http://www.jibble.org/pircbot.php

3. How to get irc4sc?

If you want to try irc4sc it's very simple :

- Request an observer role for irc4sc on the javanet website :
https://irc4sc.dev.java.net/
- Get the projects sources with CVS
- Build sip-communicator
- Build and run irc4sc
- That's it !

4. The implementation

In this part we will try to explain you how we did the implementation
of the layer between the pircbot lib and the different multi user
services from SC.

First of all, you need to know that the implementation is not totally
finished (and it never will because it needs to be maintained :p). For
this first version of irc4sc we only have implemented a small part of
the IRC RFC because of the services interfaces limitations, we will
explain this later.

For now the messages irc4sc supports are :

Related to the chat room:
   -JOIN messages: to see if someone enters a room.
   -PART messages: to see if someone parts a room.
   -QUIT messages: to see if someone quits a room.
   -KICK messages: to see if someone is kicked from the room.
   -LIST messages: to see the list of chat rooms of a server.
   -PRIVMSG messages: to see if someone send a message.

Related to chat room members:
   -NAMES messages: to see the list of users on a channel.
   -NICK messages: to see a change of a user nick name.

We listed here all the messages which are already available through
the OperationSetMultiUserChat, ChatRoom, ChatRoomMember,
ChatRoomMemberRole classes methods.

We said before that we were limited by the services interfaces, we
will explain here what's the problem and why the rest of the irc
protocol isn't implemented. Fist of all you need to know that multi
user chat isn't very developed for SC so the few services that were
available for now weren't wide enough to covert all the IRC protocol
functionalities, that's why we had to stop the implementation to
improve these services ( that's what we are doing now, cf the
"ChatRoom services related mail" on this mailing list).

Once this services are finished we can implement the support of much
more functionalities from the IRC RFC. So you need to wait a little
while we search the best way to cover all multi user chat protocols
functionalities. (It's close from a final state :wink: ) .

So now we will try to explain to you the structure of our
implementation, we will not directly talk about code, it is well
documented so we prefer let you read it by yourself :slight_smile:

That's the structure of our implementation when the bundle is launched
after the irc service is registered :

  ++++++++++++ ++++++++++++++
  > member | | member |
  ++++++++++++ ++++++++++++++
           > >
+++++++++++++++ ++++++++++++++ ++++++++++++++++++++++++++
> chatRoom | | chatRoom |--------| operationSetMultiUser |
+++++++++++++++ ++++++++++++++ ++++++++++++++++++++++++++
              > > >
            ++++++++++++++++++++++++ |
            > server |--------------------
            ++++++++++++++++++++++++
                > >
+++++++++++++++++++ |
> event_manager | |
+++++++++++++++++++ |
                > >
            +++++++++++++++++++++
            > pircbot |
            +++++++++++++++++++++

So each time we create an instance of the irc service provider we get
a stucture like this, at the beginning only a server and his event
manager whit the irc stack (pircbot) is created. After that you can
create and add chat rooms to the server through the operation set
multi user chat.

Here the server instance is used in order not to have a direct
relation from the chat rooms with the irc stack (we did this to make
it easier to switch the irc stack with another if necessary).

The event manager is used to dispatch events comming from the irc
stack and to filter them in order to separate the error messages from
the other messages.

All messages comming from the irc stack are parsed and the
informations are redirected to the different instances of the objects
which are using it and in the same time all the event listener are
notified.

5. What remains to do ?

We have implemented most of the main features of the IRC protocol but
some remains to do.

We have decided to continue to work on the project and here is a list
of features we are going to implement in the future :

- File transfert support
- DCC chat
- Add a special chatroom for the irc server

If you have any questions or suggestions feel free to contact us we
will be pleased to answer.

Loïc Kempf
Stéphane Remy

---------------------------------------------------------------------
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!

------------------------------------------------------------------------

### Eclipse Workspace Patch 1.0
#P sip-communicator
Index: src/net/java/sip/communicator/impl/gui/main/MainTabbedPane.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/gui/main/MainTabbedPane.java,v
retrieving revision 1.22
diff -u -r1.22 MainTabbedPane.java
--- src/net/java/sip/communicator/impl/gui/main/MainTabbedPane.java 12 Mar 2007 17:41:00 -0000 1.22
+++ src/net/java/sip/communicator/impl/gui/main/MainTabbedPane.java 29 May 2007 10:39:18 -0000
@@ -51,8 +51,8 @@
                          this.addTab(Messages.getI18NString("contacts").getText(),
                     contactListPanel);
- //this.addTab(Messages.getI18NString("chatRooms").getText(),
- //chatRoomsListPanel);
+ this.addTab(Messages.getI18NString("chatRooms").getText(),
+ chatRoomsListPanel);
         this.addTab(Messages.getI18NString("callList").getText(),
                     callHistoryPanel);
         this.addTab(Messages.getI18NString("dial").getText(), dialPanel); 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 29 May 2007 10:39:19 -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/protocol/jabber/ChatRoomJabberImpl.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomJabberImpl.java,v
retrieving revision 1.3
diff -u -r1.3 ChatRoomJabberImpl.java
--- src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomJabberImpl.java 24 Apr 2007 12:31:24 -0000 1.3
+++ src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomJabberImpl.java 29 May 2007 10:39:19 -0000
@@ -102,7 +102,7 @@
      * @param listener the <tt>ChatRoomChangeListener</tt> that is to be
      * registered for <tt>ChatRoomChangeEvent</tt>-s.
      */
- public void addChatRoomPropertyChangeListener(
+ public void addPropertyChangeListener(
         ChatRoomPropertyChangeListener listener)
     {
         synchronized(chatRoomPropertyChangeListeners)
@@ -118,7 +118,7 @@
      *
      * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
      */
- public void removeChatRoomPropertyChangeListener(
+ public void removePropertyChangeListener(
         ChatRoomPropertyChangeListener listener)
     {
         synchronized(chatRoomPropertyChangeListeners)
@@ -133,8 +133,8 @@
      *
      * @param listener a local user status listener.
      */
- public void addLocalUserStatusListener(
- ChatRoomLocalUserStatusListener listener)
+ public void addLocalUserParticipationListener(
+ ChatRoomLocalUserParticipationListener listener)
     {
         synchronized(localUserStatusListeners)
         {
@@ -150,7 +150,7 @@
      *
      * @param listener a local user status listener.
      */
- public void removeLocalUserStatusListener(ChatRoomLocalUserStatusListener
+ public void removeLocalUserParticipationListener(ChatRoomLocalUserParticipationListener
                                               listener)
     {
         synchronized(localUserStatusListeners)
@@ -196,7 +196,7 @@
      *
      * @param listener a participant status listener.
      */
- public void addMemberListener(ChatRoomMemberListener listener)
+ public void addMemberParticipationListener(ChatRoomMemberParticipationListener listener)
     {
         synchronized(memberListeners)
         {
@@ -212,7 +212,7 @@
      *
      * @param listener a participant status listener.
      */
- public void removeMemberListener(ChatRoomMemberListener listener)
+ public void removeMemberParticipationListener(ChatRoomMemberParticipationListener listener)
     {
         synchronized(memberListeners)
         {
@@ -796,4 +796,151 @@
             /** @todo implement ownershipGranted() */
         }
     }
+ + /**
+ * 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()
+ {
+ return null;
+ }
+ + /**
+ * 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()
+ {
+ return null;
+ }
+ + /**
+ * 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()
+ {
+ return -1;
+ }
+ + /**
+ * 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 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)
+ {
+ + }
}
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 29 May 2007 10:39:19 -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/impl/gui/main/chat/conference/ConferenceChatPanel.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java,v
retrieving revision 1.8
diff -u -r1.8 ConferenceChatPanel.java
--- src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java 3 May 2007 14:22:20 -0000 1.8
+++ src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java 29 May 2007 10:39:19 -0000
@@ -9,8 +9,10 @@
import java.util.*;
  import net.java.sip.communicator.impl.gui.*;
+//import net.java.sip.communicator.impl.gui.customcontrols.ErrorDialog;
import net.java.sip.communicator.impl.gui.i18n.*;
import net.java.sip.communicator.impl.gui.main.chat.*;
+//import net.java.sip.communicator.impl.gui.main.chatroomslist.ChatRoomsList;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
@@ -26,8 +28,8 @@
     extends ChatPanel
     implements ChatRoomMessageListener,
                 ChatRoomPropertyChangeListener,
- ChatRoomLocalUserStatusListener,
- ChatRoomMemberListener
+ ChatRoomLocalUserParticipationListener,
+ ChatRoomMemberParticipationListener
{
     private Logger logger = Logger.getLogger(ConferenceChatPanel.class);
@@ -62,9 +64,9 @@
         }
          this.chatRoom.addMessageListener(this);
- this.chatRoom.addChatRoomPropertyChangeListener(this);
- this.chatRoom.addLocalUserStatusListener(this);
- this.chatRoom.addMemberListener(this);
+ this.chatRoom.addPropertyChangeListener(this);
+ this.chatRoom.addLocalUserParticipationListener(this);
+ this.chatRoom.addMemberParticipationListener(this);
     }
      /**
@@ -356,11 +358,53 @@
     { }
- public void localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt)
+ public void localUserParticipationChanged(ChatRoomLocalUserParticipationChangeEvent evt)
     { }
- public void memberStatusChanged(ChatRoomMemberEvent evt)
+ public void memberParticipationChanged(ChatRoomMemberParticipationChangeEvent evt)
     { + /*try
+ {
+ chatRoom.join();
+ + ConfigurationManager.saveChatRoom(chatRoom);
+
+ ChatRoomsList chatRoomsList
+ this.
+ = mainFrame.getChatRoomsListPanel().getChatRoomsList();
+ + if(!chatRoomsList.containsChatRoom(chatRoom))
+ mainFrame.getChatRoomsListPanel().getChatRoomsList()
+ .addChatRoom(chatRoom);
+ }
+ catch (OperationFailedException ex)
+ {
+ logger.error("Failed to join chat room. ", ex);
+ + new ErrorDialog(mainFrame,
+ Messages.getI18NString("failedToJoinChannel",
+ new String[]{chatRoom.getName()}).getText(),
+ ex,
+ Messages.getI18NString("error").getText())
+ .showDialog();
+ }*/
+ }
+ + public boolean equals(Object o)
+ {
+ if(o != null)
+ {
+ if(o instanceof ConferenceChatPanel)
+ {
+ if((((ConferenceChatPanel) o).getChatIdentifier().equals(this.getChatIdentifier())))
+ {
+ return true;
+ }
+ else return false;
+ }
+ else return false;
+ }
+ else return false;
     }
}
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 29 May 2007 10:39:20 -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/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 29 May 2007 10:39:20 -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/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/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/impl/gui/main/chatroomslist/JoinChannelDialog.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/gui/main/chatroomslist/JoinChannelDialog.java,v
retrieving revision 1.5
diff -u -r1.5 JoinChannelDialog.java
--- src/net/java/sip/communicator/impl/gui/main/chatroomslist/JoinChannelDialog.java 3 May 2007 14:23:20 -0000 1.5
+++ src/net/java/sip/communicator/impl/gui/main/chatroomslist/JoinChannelDialog.java 29 May 2007 10:39:19 -0000
@@ -9,6 +9,7 @@
import java.awt.*;
import java.awt.event.*;
import java.util.List;
+import java.util.StringTokenizer;
  import javax.swing.*;
@@ -61,7 +62,7 @@
     {
         super(mainFrame, false);
- this.mainPanel.setPreferredSize(new Dimension(500, 150));
+ this.mainPanel.setPreferredSize(new Dimension(1000, 230));
          this.mainFrame = mainFrame;
@@ -108,15 +109,27 @@
         if(buttonName.equals("ok"))
         {
             ChatRoom chatRoom = null;
- String chatRoomName;
+ String chatRoomName = null;
+ //String response = null;
                          if(channelsList != null && channelsList.getSelectedValue() != null)
- chatRoomName = (String) channelsList.getSelectedValue();
+ {
+ chatRoom = (ChatRoom) channelsList.getSelectedValue();
+ chatRoomName = chatRoom.getName();
+ }
             else
+ {
                 chatRoomName = channelTextField.getText();
+ }
                          try
             {
+ /*if(response!=null)
+ {
+ StringTokenizer tokenizer = new StringTokenizer(response);
+ tokenizer.nextToken();
+ chatRoomName = tokenizer.nextToken();
+ }*/
                 chatRoom = multiChatOpSet.findRoom(chatRoomName);
             }
             catch (Exception ex)
@@ -147,6 +160,8 @@
                     if(!chatRoomsList.containsChatRoom(chatRoom))
                         mainFrame.getChatRoomsListPanel().getChatRoomsList()
                             .addChatRoom(chatRoom);
+ + this.dispose();
                 }
                 catch (OperationFailedException ex)
                 {
@@ -190,8 +205,8 @@
                 logger.error("Could not obtain existing chat rooms.", ex);
             }
      - if(list != null && list.size() > 0)
- {
+ //if(list != null && list.size() > 0)
+ //{
                 channelsList = new JList(list.toArray());
                 channelsListScrollPane.getViewport().add(channelsList);
                 @@ -199,7 +214,7 @@
                                  mainPanel.revalidate();
                 mainPanel.repaint();
- }
+ //}
         }
     }
     Index: src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomsList.java

RCS file: /cvs/sip-communicator/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomsList.java,v
retrieving revision 1.5
diff -u -r1.5 ChatRoomsList.java
--- src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomsList.java 3 May 2007 14:23:20 -0000 1.5
+++ src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomsList.java 29 May 2007 10:39:19 -0000
@@ -81,6 +81,16 @@
     }
          /**
+ * Remove a chat room from this list.
+ *
+ * @param chatRoom the <tt>ChatRoom</tt> to remove
+ */
+ public void removeChatRoom(ChatRoom chatRoom)
+ {
+ listModel.removeElement(chatRoom);
+ }
+ + /**
      * Adds a chat room to this list.
      *
      * @param chatRoom the <tt>ChatRoom</tt> to add
@@ -132,7 +142,15 @@
              ChatPanel chatPanel = chatWindowManager.getChatRoom(chatRoom);
- chatWindowManager.openChat(chatPanel, true);
+ chatWindowManager.openChat(chatPanel, false);
+ + /*ChatWindow chatWindow = chatPanel.getChatWindow();
+ + chatWindow.addChat(chatPanel);
+ + chatWindow.setCurrentChatPanel(chatPanel);
+ + chatPanel.setCaretToEnd();*/
         }
     }
@@ -176,6 +194,34 @@
                 rightButtonMenu.setVisible(true);
             }
         }
+ else if(selectedValue instanceof ChatRoom)
+ {
+ ChatRoom chatRoom
+ = (ChatRoom) selectedValue;
+
+ if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0)
+ {
+
+ ChatRoomRightButtonMenu rightButtonMenu
+ = new ChatRoomRightButtonMenu(mainFrame, chatRoom);
+
+ rightButtonMenu.setInvoker(this);
+
+ rightButtonMenu.setLocation(e.getX()
+ + mainFrame.getX() + 5, e.getY() + mainFrame.getY()
+ + 105);
+
+ rightButtonMenu.setVisible(true);
+ }
+ else if((e.getModifiers() & InputEvent.BUTTON2_MASK) != 0)
+ {
+ ChatWindowManager chatWindowManager = mainFrame.getChatWindowManager();
+
+ ChatPanel chatPanel = chatWindowManager.getChatRoom(chatRoom);
+
+ chatWindowManager.openChat(chatPanel, true);
+ }
+ }
     }
      public void mouseReleased(MouseEvent e)
Index: test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java

RCS file: /cvs/sip-communicator/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java,v
retrieving revision 1.2
diff -u -r1.2 TestOperationSetMultiUserChat.java
--- test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java 23 Apr 2007 18:32:14 -0000 1.2
+++ test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java 29 May 2007 10:39:20 -0000
@@ -10,8 +10,6 @@
import junit.framework.*;
import net.java.sip.communicator.service.protocol.*;
import java.util.*;
-import net.java.sip.communicator.service.protocol.event.
- ChatRoomMemberEvent;
import net.java.sip.communicator.service.protocol.event.*;
  /**
@@ -326,7 +324,7 @@
     }
      private class ParticipantStatusEventCollector
- implements ChatRoomMemberListener
+ implements ChatRoomMemberParticipationListener
     {
          /**
@@ -334,8 +332,8 @@
          *
          * @param event the event containing the source call.
          */
- public void memberStatusChanged(
- ChatRoomMemberEvent evt)
+ public void memberParticipationChanged(
+ ChatRoomMemberParticipationChangeEvent evt)
         {
             synchronized(this)
             {
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 29 May 2007 10:39:20 -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 29 May 2007 10:39:20 -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 29 May 2007 10:39:20 -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/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/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java

RCS file: src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java
diff -N src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,100 @@
+/*
+ * 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.impl.gui.main.chatroomslist;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+
+import javax.swing.*;
+
+import net.java.sip.communicator.impl.gui.*;
+import net.java.sip.communicator.impl.gui.i18n.*;
+import net.java.sip.communicator.impl.gui.main.*;
+import net.java.sip.communicator.impl.gui.main.chat.ChatPanel;
+import net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager;
+import net.java.sip.communicator.impl.gui.main.chatroomslist.chatroomwizard.*;
+import net.java.sip.communicator.impl.gui.utils.*;
+import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.service.gui.event.*;
+import net.java.sip.communicator.service.protocol.*;
+
+/**
+ * The <tt>ChatRoomsListRightButtonMenu</tt> is the menu, opened when user clicks
+ * with the right mouse button on the chat rooms list panel. It's the one that
+ * contains the create chat room item.
+ *
+ * @author Yana Stamcheva
+ */
+public class ChatRoomRightButtonMenu
+ extends JPopupMenu
+ implements ActionListener
+{
+ private I18NString quitChannelString
+ = Messages.getI18NString("quitChatRoom");
+
+ private JMenuItem quitChannelItem = new JMenuItem(
+ quitChannelString.getText(),
+ new ImageIcon(ImageLoader.getImage(ImageLoader.REMOVE_16x16_ICON)));
+
+ private MainFrame mainFrame;
+ + private ChatRoom chatRoom = null;
+ + /**
+ * Creates an instance of <tt>ChatRoomsListRightButtonMenu</tt>.
+ */
+ public ChatRoomRightButtonMenu(MainFrame mainFrame, ChatRoom chatRoom)
+ {
+ super();
+
+ this.mainFrame = mainFrame;
+ + this.chatRoom = chatRoom;
+ + this.setLocation(getLocation());
+
+ this.init();
+ }
+
+ /**
+ * Initializes the menu, by adding all containing menu items.
+ */
+ private void init()
+ {
+ this.add(quitChannelItem);
+ + this.quitChannelItem.setName("quitChatRoom");
+ + this.quitChannelItem
+ .setMnemonic(quitChannelString.getMnemonic());
+ + this.quitChannelItem.addActionListener(this);
+ }
+ + /**
+ * Handles the <tt>ActionEvent</tt>. Determines which menu item was
+ * selected and makes the appropriate operations.
+ */
+ public void actionPerformed(ActionEvent e)
+ {
+
+ JMenuItem menuItem = (JMenuItem) e.getSource();
+ String itemName = menuItem.getName();
+
+ if (itemName.equals("quitChatRoom"))
+ {
+ this.chatRoom.leave();
+ ChatWindowManager chatWindowManager = mainFrame.getChatWindowManager();
+ ChatPanel chatPanel = chatWindowManager.getChatRoom(chatRoom);
+ chatWindowManager.closeChat(chatPanel);
+ mainFrame.getChatRoomsListPanel().getChatRoomsList().removeChatRoom(chatRoom);
+ }
+ }
+}
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/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/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/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);
+
+}

------------------------------------------------------------------------

---------------------------------------------------------------------
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