#include <irc/session.hpp>
IRC session class.
Public Member Functions | |
| session (std::shared_ptr< connection > connection_, std::string nick, std::string user_name_, std::string fullname_) | |
| Constructor. More... | |
| const std::string & | get_nick () const |
| Returns the user nick name. More... | |
| user & | get_self () |
| Returns a reference to our current user details. More... | |
| const user & | get_self () const |
| Returns a const reference to our current user details. 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_channel_iterator | channel_begin () const |
| Returns a const iterator to the beginning of the channel list. More... | |
| const_channel_iterator | channel_end () const |
| Returns a const iterator to the end of the channel list. More... | |
| void | async_join (const std::string &channel_name) |
| Joins the specified channel. More... | |
| void | async_part (const channel &chan) |
| Leaves the specified channel. More... | |
| void | async_privmsg (const std::string &target, const std::string &msg) |
| Sends a message to the specified target. More... | |
| void | async_change_nick (const std::string &target) |
| Changes our current nickname. More... | |
| void | stop () |
| Closes the connection. More... | |
| template<typename F > | |
| bsig::connection | connect_on_motd (F &&f) |
| Connect to the on_motd signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_join_channel (F &&f) |
| Connect to the on_join_channel signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_notice (F &&f) |
| Connect to the on_notice signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_user_notice (F &&f) |
| Connect to the on_user_notice signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_new_user (F &&f) |
| Connect to the on_new_user signal. More... | |
| irc::session::session | ( | std::shared_ptr< connection > | connection_, |
| std::string | nick, | ||
| std::string | user_name_, | ||
| std::string | fullname_ | ||
| ) |
Constructor.
| connection_ | An enstablished IRC connection. |
| nick | A nickname. |
| user_name_ | An user name. |
| fullname_ | A real, full user name. |
| void irc::session::async_change_nick | ( | const std::string & | target | ) |
Changes our current nickname.
| target | The new nick name. |
| void irc::session::async_join | ( | const std::string & | channel_name | ) |
Joins the specified channel.
| channel_name | The channel to join. |
| void irc::session::async_part | ( | const channel & | chan | ) |
Leaves the specified channel.
| chan | The channel to leave. |
| void irc::session::async_privmsg | ( | const std::string & | target, |
| const std::string & | msg | ||
| ) |
Sends a message to the specified target.
| target | The target where to send the message, a channel or a nickname. |
| msg | The message to send. |
| const_user_iterator irc::session::begin_users | ( | ) | const |
Returns a const iterator to the beginning of the user list.
| const_channel_iterator irc::session::channel_begin | ( | ) | const |
Returns a const iterator to the beginning of the channel list.
| const_channel_iterator irc::session::channel_end | ( | ) | const |
Returns a const iterator to the end of the channel list.
| bsig::connection irc::session::connect_on_join_channel | ( | F && | f | ) |
Connect to the on_join_channel signal.
This signal is triggered when an user joins an IRC channel.
| f | A callback function with the following signature: void f(irc::channel& chan)
|
| bsig::connection irc::session::connect_on_motd | ( | F && | f | ) |
Connect to the on_motd signal.
This signal is triggered when receiving the Message Of The Day from the IRC server.
| f | A callback function with the following signature: void f(std::string msg)
|
| bsig::connection irc::session::connect_on_new_user | ( | F && | f | ) |
Connect to the on_new_user signal.
| f | A callback function with the following signature: void f(user& u)
|
| bsig::connection irc::session::connect_on_notice | ( | F && | f | ) |
Connect to the on_notice signal.
This signal is triggered when an irc::command::notice was sent.
| f | A callback function with the following signature: void f(std::string msg)
|
| bsig::connection irc::session::connect_on_user_notice | ( | F && | f | ) |
Connect to the on_user_notice signal.
This signal is triggered when an irc::command::notice was sent to an user.
| f | A callback function with the following signature: void f(user& u, const std::string& msg)
|
| const_user_iterator irc::session::end_users | ( | ) | const |
Returns a const iterator to the end of the user list.
| const std::string& irc::session::get_nick | ( | ) | const |
Returns the user nick name.
| user& irc::session::get_self | ( | ) |
Returns a reference to our current user details.
| const user& irc::session::get_self | ( | ) | const |
Returns a const reference to our current user details.
| void irc::session::stop | ( | ) |
Closes the connection.