diff options
author | louiz’ <louiz@louiz.org> | 2020-06-14 22:54:42 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2020-06-15 00:18:51 +0200 |
commit | 2e1ddeb6547e140e9651231fedcd00e8ee4b1ccd (patch) | |
tree | 8b61842eaa892fde2b5679672de572a9ff7a4e47 /src/irc/irc_client.hpp | |
parent | 655bc344d47bc79e500a351c2953f6b5003f40ec (diff) | |
download | biboumi-2e1ddeb6547e140e9651231fedcd00e8ee4b1ccd.tar.gz biboumi-2e1ddeb6547e140e9651231fedcd00e8ee4b1ccd.tar.bz2 biboumi-2e1ddeb6547e140e9651231fedcd00e8ee4b1ccd.tar.xz biboumi-2e1ddeb6547e140e9651231fedcd00e8ee4b1ccd.zip |
Implement SASL plain authentication
Diffstat (limited to 'src/irc/irc_client.hpp')
-rw-r--r-- | src/irc/irc_client.hpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index cfb3d21..e2ad8b9 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -1,8 +1,9 @@ #pragma once - #include <irc/irc_message.hpp> #include <irc/irc_channel.hpp> +#include <irc/capability.hpp> +#include <irc/sasl.hpp> #include <irc/iid.hpp> #include <bridge/history_limit.hpp> @@ -232,6 +233,17 @@ public: */ void on_invited(const IrcMessage& message); /** + * The IRC server sends a CAP message, as part of capabilities negociation. It could be a ACK, + * NACK, or something else + */ + void on_cap(const IrcMessage& message); +private: + void cap_end(); +public: + void on_authenticate(const IrcMessage& message); + void on_sasl_success(const IrcMessage& message); + void on_sasl_login(const IrcMessage& message); + /** * The channel has been completely joined (self presence, topic, all names * received etc), send the self presence and topic to the XMPP user. */ @@ -360,6 +372,12 @@ private: */ bool welcomed; /** + * Whether or not we are trying to authenticate using sasl. If this is true we need to wait for a + * successful auth + */ + SaslState sasl_state{SaslState::unneeded}; + std::map<std::string, Capability> capabilities; + /** * See http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt section 3.3 * We store the possible chanmodes in this object. * chanmodes[0] contains modes of type A, [1] of type B etc |