Fix echo-message for *status

Close #1705
This commit is contained in:
Alexey Sokolov
2020-03-29 08:45:10 +01:00
parent 6d1ef8d099
commit d229761821
2 changed files with 16 additions and 2 deletions
+2
View File
@@ -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 -2
View File
@@ -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