#include <irc/channel.hpp>
IRC channel class.
Public Member Functions | |
| channel (session &connection__, std::string name_) | |
| Constructor. More... | |
| session & | get_session () |
| Returns the associated session object. More... | |
| const session & | get_session () const |
| Returns the associated session object (const). More... | |
| const std::string & | get_name () const |
| Returns the channel name. More... | |
| const std::string & | get_topic () const |
| Returns the channel topic. More... | |
| bool | is_operator (const user &u) const |
| Returns if the specified user is a channel operator. More... | |
| void | async_send_message (const std::string &msg) |
| Sends a message in to the channel. More... | |
| void | async_part () |
| Leaves the channel. More... | |
| user_iterator | begin_users () |
| Returns an iterator to the beginning of the user list. More... | |
| user_iterator | end_users () |
| Returns an iterator to the end of the user list. More... | |
| const_user_iterator | begin_users () const |
| Returns a const iterator to the beginning of the user list. More... | |
| const_user_iterator | end_users () const |
| Returns a const iterator to the end of the user list. More... | |
| const mode_block & | get_modes () const |
| Returns the mode block for this channel. More... | |
| mode_block & | get_modes () |
| Returns the mode block for this channel (const version). More... | |
| void | add_modes (const prefix &pfx, mode_list modes) |
| Adds the specified modes to the channel. More... | |
| void | remove_modes (const prefix &pfx, const mode_list &modes) |
| Removes the specified modes from the channel. More... | |
| void | message (const shared_user &user, const std::string message) |
| Sends a message to the channel. More... | |
| void | user_part (const shared_user &user, const optional_string &msg) |
| An user has left the channel. More... | |
| void | user_join (const shared_user &user) |
| An user has joined the channel. More... | |
| bool | add_user (const shared_user &user) |
| Adds an user to the channel user list. More... | |
| void | user_quit (const shared_user &user, const std::string &msg) |
| An user has quitted IRC. More... | |
| void | set_topic (std::string str) |
| Sets the channel topic. More... | |
| void | set_operator (const user &u) |
| Sets a specified user as channel operator. More... | |
| void | list_users () |
| Sends a command::list request to the IRC server. More... | |
| void | part () |
| Sends a command::part request to the IRC server to leave this channel. More... | |
| template<typename F > | |
| bsig::connection | connect_on_message (F &&f) |
| Connect to the on_message signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_topic_change (F &&f) |
| Connect to the on_topic signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_user_join (F &&f) |
| Connect to the on_user_join signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_user_part (F &&f) |
| Connect to the on_user_join signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_channel_part (F &&f) |
| Connect to the on_channel_part signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_list_users (F &&f) |
| Connect to the on_list_users signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_set_mode (F &&f) |
| Connect to the on_set_mode signal. More... | |
| irc::channel::channel | ( | session & | connection__, |
| std::string | name_ | ||
| ) |
Constructor.
| connection__ | The associated IRC session. |
| name_ | The channel name. |
| void irc::channel::add_modes | ( | const prefix & | pfx, |
| mode_list | modes | ||
| ) |
Adds the specified modes to the channel.
| pfx | The user prefix who sets the new modes. |
| modes | The new modes. |
| bool irc::channel::add_user | ( | const shared_user & | user | ) |
Adds an user to the channel user list.
| user | The new user entry. |
| void irc::channel::async_part | ( | ) |
Leaves the channel.
| void irc::channel::async_send_message | ( | const std::string & | msg | ) |
Sends a message in to the channel.
| msg | The message to send. |
| user_iterator irc::channel::begin_users | ( | ) |
Returns an iterator to the beginning of the user list.
| const_user_iterator irc::channel::begin_users | ( | ) | const |
Returns a const iterator to the beginning of the user list.
| bsig::connection irc::channel::connect_on_channel_part | ( | F && | f | ) |
Connect to the on_channel_part signal.
This signal is triggered when we leaves the channel.
| f | A callback function with the following signature: void f(channel& chan)
|
| bsig::connection irc::channel::connect_on_list_users | ( | F && | f | ) |
Connect to the on_list_users signal.
This signal is triggered when we required a command::list.
| f | A callback function with the following signature: void f()
|
| bsig::connection irc::channel::connect_on_message | ( | F && | f | ) |
Connect to the on_message signal.
This signal is triggered when a message was sent to the channel.
| f | A callback function with the following signature: void f(channel& chan, user& usr, const std::string& msg)
|
| bsig::connection irc::channel::connect_on_set_mode | ( | F && | f | ) |
Connect to the on_set_mode signal.
This signal is triggered when channel modes changed.
| f | A callback function with the following signature: void f( const prefix& pfx, const std::vector<std::pair<char, optional_string>>& modes)
|
| bsig::connection irc::channel::connect_on_topic_change | ( | F && | f | ) |
Connect to the on_topic signal.
This signal is triggered when the topic has changed.
| f | A callback function with the following signature: void f(channel& chan, const std::string& new_topic)
|
| bsig::connection irc::channel::connect_on_user_join | ( | F && | f | ) |
Connect to the on_user_join signal.
This signal is triggered when an user joins the channel.
| f | A callback function with the following signature: void f(channel& chan, user& usr)
|
| bsig::connection irc::channel::connect_on_user_part | ( | F && | f | ) |
Connect to the on_user_join signal.
This signal is triggered when an user leaves the channel.
| f | A callback function with the following signature: void f(channel& chan, user& usr, const optional_string& msg)
|
| user_iterator irc::channel::end_users | ( | ) |
Returns an iterator to the end of the user list.
| const_user_iterator irc::channel::end_users | ( | ) | const |
Returns a const iterator to the end of the user list.
| const mode_block& irc::channel::get_modes | ( | ) | const |
Returns the mode block for this channel.
| mode_block& irc::channel::get_modes | ( | ) |
Returns the mode block for this channel (const version).
| const std::string& irc::channel::get_name | ( | ) | const |
Returns the channel name.
| session& irc::channel::get_session | ( | ) |
Returns the associated session object.
| const session& irc::channel::get_session | ( | ) | const |
Returns the associated session object (const).
| const std::string& irc::channel::get_topic | ( | ) | const |
Returns the channel topic.
| bool irc::channel::is_operator | ( | const user & | u | ) | const |
Returns if the specified user is a channel operator.
| u | The user to check. |
u is an operator, false otherwise. | void irc::channel::list_users | ( | ) |
Sends a command::list request to the IRC server.
| void irc::channel::message | ( | const shared_user & | user, |
| const std::string | message | ||
| ) |
Sends a message to the channel.
| user | The user who sent the message. |
| message | The message. |
| void irc::channel::part | ( | ) |
Sends a command::part request to the IRC server to leave this channel.
| void irc::channel::remove_modes | ( | const prefix & | pfx, |
| const mode_list & | modes | ||
| ) |
Removes the specified modes from the channel.
| pfx | The user prefix who sets the modes. |
| modes | The modes to remove. |
| void irc::channel::set_operator | ( | const user & | u | ) |
Sets a specified user as channel operator.
| u | The user to set as op. |
| void irc::channel::set_topic | ( | std::string | str | ) |
Sets the channel topic.
| str | The new channel topic. |
| void irc::channel::user_join | ( | const shared_user & | user | ) |
An user has joined the channel.
| user | The new user entry. |
| void irc::channel::user_part | ( | const shared_user & | user, |
| const optional_string & | msg | ||
| ) |
An user has left the channel.
| user | The user who leaves the channel. |
| msg | A message to display when the user leave the channel (optional). |
| void irc::channel::user_quit | ( | const shared_user & | user, |
| const std::string & | msg | ||
| ) |
An user has quitted IRC.
| user | The user that has quitted. |
| msg | A quit message (optional). |