mirror of
https://github.com/znc/znc.git
synced 2026-07-06 01:41:12 +02:00
@@ -1234,6 +1234,8 @@ bool CClient::OnTextMessage(CTextMessage& Message) {
|
||||
}
|
||||
|
||||
if (sTarget.TrimPrefix(m_pUser->GetStatusPrefix())) {
|
||||
EchoMessage(Message);
|
||||
|
||||
if (sTarget.Equals("status")) {
|
||||
CString sMsg = Message.GetText();
|
||||
UserCommand(sMsg);
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "znctest.h"
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
#include "znctest.h"
|
||||
|
||||
using testing::HasSubstr;
|
||||
|
||||
namespace znc_inttest {
|
||||
@@ -244,7 +245,8 @@ TEST_F(ZNCTest, AwayNotify) {
|
||||
client.Write("USER user/test x x :x");
|
||||
QByteArray cap_ls;
|
||||
client.ReadUntilAndGet(" LS :", cap_ls);
|
||||
ASSERT_THAT(cap_ls.toStdString(), AllOf(HasSubstr("cap-notify"), Not(HasSubstr("away-notify"))));
|
||||
ASSERT_THAT(cap_ls.toStdString(),
|
||||
AllOf(HasSubstr("cap-notify"), Not(HasSubstr("away-notify"))));
|
||||
client.Write("CAP REQ :cap-notify");
|
||||
client.ReadUntil("ACK :cap-notify");
|
||||
client.Write("CAP END");
|
||||
@@ -284,5 +286,15 @@ TEST_F(ZNCTest, JoinKey) {
|
||||
ircd.ReadUntil("JOIN #znc secret");
|
||||
}
|
||||
|
||||
TEST_F(ZNCTest, StatusEchoMessage) {
|
||||
auto znc = Run();
|
||||
auto ircd = ConnectIRCd();
|
||||
auto client = LoginClient();
|
||||
client.Write("CAP REQ :echo-message");
|
||||
client.Write("PRIVMSG *status :blah");
|
||||
client.ReadUntil(":nick!user@irc.znc.in PRIVMSG *status :blah");
|
||||
client.ReadUntil(":*status!znc@znc.in PRIVMSG nick :Unknown command");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace znc_inttest
|
||||
|
||||
Reference in New Issue
Block a user