diff options
author | Peter Powell <petpow@saberuk.com> | 2013-04-28 12:17:53 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-05-14 23:30:12 +0100 |
commit | 226a95aab09b9e1f43f61e78179bfa1135816c2d (patch) | |
tree | 373f6d34cbfbea9e392cb4ab6515aca3a54a6e7e /src/modules/extra | |
parent | b89aa87280767f47381b8a612f73f1d0fe682e2e (diff) |
Add method for writing server notices.
This allows us to send a server notice to a user without worrying
about whether they are registered or not.
If a user receives a server notice and they are not registered
then the nickname field will contain an asterisk instead of their
nick name.
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 6 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 00dff68e6..b42853912 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -745,10 +745,10 @@ class ModuleSSLGnuTLS : public Module ssl_cert* cert = sessions[user->eh.GetFd()].cert; if (cert->fingerprint.empty()) - user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick.c_str(), cipher.c_str()); + user->WriteNotice("*** You are connected using SSL cipher '" + cipher + "'"); else - user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"" - " and your SSL fingerprint is %s", user->nick.c_str(), cipher.c_str(), cert->fingerprint.c_str()); + user->WriteNotice("*** You are connected using SSL cipher '" + cipher + + "' and your SSL fingerprint is " + cert->fingerprint); } } } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 5a0e56db2..6063b792c 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -287,10 +287,10 @@ class ModuleSSLOpenSSL : public Module if (sessions[user->eh.GetFd()].sess) { if (!sessions[user->eh.GetFd()].cert->fingerprint.empty()) - user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"" - " and your SSL fingerprint is %s", user->nick.c_str(), SSL_get_cipher(sessions[user->eh.GetFd()].sess), sessions[user->eh.GetFd()].cert->fingerprint.c_str()); + user->WriteNotice("*** You are connected using SSL cipher '" + std::string(SSL_get_cipher(sessions[user->eh.GetFd()].sess)) + + "' and your SSL fingerprint is " + sessions[user->eh.GetFd()].cert->fingerprint); else - user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick.c_str(), SSL_get_cipher(sessions[user->eh.GetFd()].sess)); + user->WriteNotice("*** You are connected using SSL cipher '" + std::string(SSL_get_cipher(sessions[user->eh.GetFd()].sess)) + "'"); } } } |