Class: IRC::Messages::PartMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/irc/messages/part_message.rb

Overview

4.2.2 Part message

Command: PART Parameters: <channel>,<channel>

The PART message causes the client sending the message to be removed from the list of active users for all given channels listed in the parameter string.

Numeric Replies:

ERR_NEEDMOREPARAMS ERR_NOSUCHCHANNEL ERR_NOTONCHANNEL

Examples:

PART #twilight_zone ; leave channel “#twilight_zone”

PART #oz-ops,&group5 ; leave both channels “&group5” and

; "#oz-ops".

Constant Summary collapse

CODE =
"PART"

Constants inherited from Message

Message::MESSAGE_FORMAT

Constants included from Codes

Codes::ERR_ALREADYREGISTRED, Codes::ERR_BADCHANMASK, Codes::ERR_BADCHANNAME, Codes::ERR_BADCHANNELKEY, Codes::ERR_BANNEDFROMCHAN, Codes::ERR_CANNOTSENDTOCHAN, Codes::ERR_CANTKILLSERVER, Codes::ERR_CHANNELISFULL, Codes::ERR_CHANOPRIVSNEEDED, Codes::ERR_ERRONEUSNICKNAME, Codes::ERR_FILEERROR, Codes::ERR_INVALIDUSERNAME, Codes::ERR_INVITEONLYCHAN, Codes::ERR_KEYSET, Codes::ERR_LINKCHANNEL, Codes::ERR_NEEDMOREPARAMS, Codes::ERR_NICKCOLLISION, Codes::ERR_NICKNAMEINUSE, Codes::ERR_NOADMININFO, Codes::ERR_NOLOGIN, Codes::ERR_NOMOTD, Codes::ERR_NONICKNAMEGIVEN, Codes::ERR_NOOPERHOST, Codes::ERR_NOORIGIN, Codes::ERR_NOPERMFORHOST, Codes::ERR_NOPRIVILEGES, Codes::ERR_NORECIPIENT, Codes::ERR_NOSERVICEHOST, Codes::ERR_NOSUCHCHANNEL, Codes::ERR_NOSUCHNICK, Codes::ERR_NOSUCHSERVER, Codes::ERR_NOTEXTTOSEND, Codes::ERR_NOTONCHANNEL, Codes::ERR_NOTOPLEVEL, Codes::ERR_NOTREGISTERED, Codes::ERR_PASSWDMISMATCH, Codes::ERR_SECUREONLYCHAN, Codes::ERR_SUMMONDISABLED, Codes::ERR_TARGETTOOFAST, Codes::ERR_TOOMANYCHANNELS, Codes::ERR_TOOMANYTARGETS, Codes::ERR_UMODEUNKNOWNFLAG, Codes::ERR_UNKNOWNCOMMAND, Codes::ERR_UNKNOWNMODE, Codes::ERR_USERNOTINCHANNEL, Codes::ERR_USERONCHANNEL, Codes::ERR_USERSDISABLED, Codes::ERR_USERSDONTMATCH, Codes::ERR_WASNOSUCHNICK, Codes::ERR_WILDTOPLEVEL, Codes::ERR_YOUREBANNEDCREEP, Codes::ERR_YOUWILLBEBANNED, Codes::RPL_ADMINEMAIL, Codes::RPL_ADMINLOC1, Codes::RPL_ADMINLOC2, Codes::RPL_ADMINME, Codes::RPL_AWAY, Codes::RPL_BANLIST, Codes::RPL_BOUNCE, Codes::RPL_CHANNELMODEIS, Codes::RPL_CLOSEEND, Codes::RPL_CLOSING, Codes::RPL_CREATED, Codes::RPL_ENDOFBANLIST, Codes::RPL_ENDOFINFO, Codes::RPL_ENDOFLINKS, Codes::RPL_ENDOFMOTD, Codes::RPL_ENDOFNAMES, Codes::RPL_ENDOFSERVICES, Codes::RPL_ENDOFSTATS, Codes::RPL_ENDOFUSERS, Codes::RPL_ENDOFWHO, Codes::RPL_ENDOFWHOIS, Codes::RPL_ENDOFWHOWAS, Codes::RPL_INFO, Codes::RPL_INFOSTART, Codes::RPL_INVITING, Codes::RPL_ISON, Codes::RPL_ISUPPORT, Codes::RPL_KILLDONE, Codes::RPL_LINKS, Codes::RPL_LIST, Codes::RPL_LISTEND, Codes::RPL_LISTSTART, Codes::RPL_LUSERCHANNELS, Codes::RPL_LUSERCLIENT, Codes::RPL_LUSERME, Codes::RPL_LUSEROP, Codes::RPL_LUSERUNKNOWN, Codes::RPL_MOTD, Codes::RPL_MOTDSTART, Codes::RPL_MYINFO, Codes::RPL_MYPORTIS, Codes::RPL_NAMREPLY, Codes::RPL_NONE, Codes::RPL_NOTOPIC, Codes::RPL_NOUSERS, Codes::RPL_NOWAWAY, Codes::RPL_REHASHING, Codes::RPL_SERVICE, Codes::RPL_SERVICEINFO, Codes::RPL_SERVLIST, Codes::RPL_SERVLISTEND, Codes::RPL_STATSCLINE, Codes::RPL_STATSCOMMANDS, Codes::RPL_STATSHLINE, Codes::RPL_STATSILINE, Codes::RPL_STATSKLINE, Codes::RPL_STATSLINKINFO, Codes::RPL_STATSLLINE, Codes::RPL_STATSNLINE, Codes::RPL_STATSOLINE, Codes::RPL_STATSQLINE, Codes::RPL_STATSUPTIME, Codes::RPL_STATSYLINE, Codes::RPL_SUMMONING, Codes::RPL_TIME, Codes::RPL_TOPIC, Codes::RPL_TOPICINFO, Codes::RPL_TRACECLASS, Codes::RPL_TRACECONNECTING, Codes::RPL_TRACEHANDSHAKE, Codes::RPL_TRACELINK, Codes::RPL_TRACELOG, Codes::RPL_TRACENEWTYPE, Codes::RPL_TRACEOPERATOR, Codes::RPL_TRACESERVER, Codes::RPL_TRACEUNKNOWN, Codes::RPL_TRACEUSER, Codes::RPL_UMODEIS, Codes::RPL_UNAWAY, Codes::RPL_USERHOST, Codes::RPL_USERS, Codes::RPL_USERSSTART, Codes::RPL_VERSION, Codes::RPL_WELCOME, Codes::RPL_WHOISCHANNELS, Codes::RPL_WHOISCHANOP, Codes::RPL_WHOISIDLE, Codes::RPL_WHOISOPERATOR, Codes::RPL_WHOISSERVER, Codes::RPL_WHOISUSER, Codes::RPL_WHOREPLY, Codes::RPL_WHOWASUSER, Codes::RPL_YOUREOPER, Codes::RPL_YOURHOST

Instance Attribute Summary collapse

Attributes inherited from Message

#code, #host, #login, #message, #nick, #raw_message, #server

Instance Method Summary collapse

Methods inherited from Message

#==, #eql?, #initialize, is_valid?, #to_s

Constructor Details

This class inherits a constructor from IRC::Messages::Message

Instance Attribute Details

#channelObject (readonly)

Returns the value of attribute channel.



60
61
62
# File 'lib/irc/messages/part_message.rb', line 60

def channel
  @channel
end

Instance Method Details

#handle(context) ⇒ Object

Notify all connection listeners, that a user has left a channel.



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/irc/messages/part_message.rb', line 63

def handle(context)

  # Notify all connection listeners by calling their on_server_response method.
  super(context)
  
  # Notify all connection listeners by calling their on_part method.
  notify(context) do |connection_listener| 
    connection_listener.on_part(context, context.lookup_channel(channel), context.lookup_user(nick))
  end

end