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