ServerSession¶
(c) 2013-2014 http://ircanywhere.com
Author: Rodrigo Silveira
IRCAnywhere server/serversession.js
disconnectUser
()¶Disconnects the socket.
Returns: void.. js:class:: ServerSession.ServerSession(socket) Handles the communication between an IRC client and ircanywhere’s IRC server. Instantiated on every new client connection.
Arguments:
- socket (object) – Connection socket to the client
Returns: void
-
ServerSession.
debug
¶ A flag to determine whether debug logging is enabled or not
Type: boolean
-
ServerSession.
init
()¶ Initializes session.
Returns: void
-
ServerSession.
pass
(message)¶ Handles PASS message from client. Stores password for login.
Arguments: - message (object) – Received message
Returns: void
-
ServerSession.
nick
(message)¶ Handles NICK message from client. If message arrives before welcome, just store nickname temporarily to use on the welcome message. Otherwise forward it.
Arguments: - message (object) – Received message
Returns: void
-
ServerSession.
quit
()¶ Handles QUIT message from client. Disconnects the user.
Returns: void
-
ServerSession.
user
(message)¶ Handles USER message from client. Start login sequence. Username should contain network information if more then one network is registered. Username with network is in the form:
Arguments: - message (object) – Received message
Returns: void
-
ServerSession.
setup
()¶ Sets up client to listen to IRC activity.
Returns: void
-
ServerSession.
handleEvent
(event)¶ Handle IRC events.
Arguments: - event (object) – Event to handle
Returns: void
-
ServerSession.
handleIrcMessage
(ircMessage)¶ Forwards messages that are not stored in the events collection in the database.
Arguments: - ircMessage (object) – Irc Message object
Returns: void
-
ServerSession.
sendWelcome
()¶ Sends stored welcome message from network to client. Message order is registered, lusers, nick (to set to stored nick), motd and usermode.
-
ServerSession.
sendJoins
()¶ Sends to client a join message for each active channel tab.
-
ServerSession.
sendChannelInfo
(tab)¶ Sends channel information, such as NAMES, TOPIC etc
Arguments: - tab (object) – Channel tab
Returns: void
-
ServerSession.
sendPlayback
()¶ Sends playback messages to client.
Returns: void
-
ServerSession.
privmsg
(message)¶ Handles PRIVMSG messages from client. Forwards to ircHandler and to ircFactory.
Arguments: - message (object) – Received message
Returns: void
-
ServerSession.
onClientMessage
(message, command)¶ Handles all message that do not have a specific handler.
Arguments: - message (object) – Received message
- command (string) – Messages command
Returns: void
-
ServerSession.
sendRaw
(rawMessage)¶ Sends a raw message to the client
Arguments: - rawMessage (string) – Raw message
Returns: void