Ejemplo n.º 1
0
// チャンネル更新ストリーム受信時
void CMainWindow::onChannelStream(CStreamEvent<CTopicMessage>& event)
{
    CChatServiceBase* service = m_serviceHolder->getService(
            event.getConnectionId());

    // データ更新
    CTopicMessage* log = event.getServiceLog();
    wxString channelName = log->getChannelName();
    wxString topic = log->getTopic();
    service->onGetChannelStream(channelName, topic);
    service->addLog(event.getServiceLog());

    m_logHolder->pushLog(event.getServiceLog());

    // 表示の更新
    m_view->displayLogs(m_logHolder->getLogs(), m_serviceHolder); // ログペイン

    // 現在のチャンネルならばタイトルを更新
    if (event.getServiceLog()->getChannelName() == service->getCurrentChannel()
            && m_serviceHolder->getCurrentServiceId()
                    == event.getConnectionId()){

        m_view->addMessage(event.getServiceLog());
        displayTitle(channelName, topic, event.getConnectionId());
    }
}
Ejemplo n.º 2
0
    EModRet OnTopicMessage(CTopicMessage& Message) override {
        const CNick& Nick = Message.GetNick();
        CChan& Channel = *Message.GetChan();
        const CString sTopic = Message.GetTopic();
        AddBuffer(Channel,
                  Nick.GetNickMask() + " changed the topic to: " + sTopic,
                  &Message.GetTime(), Message.GetTags());

        return CONTINUE;
    }
Ejemplo n.º 3
0
CConnectionEventBase* CIRCEventFactory::createTopicMessageEvent(
        const CIRCResponseData& message) const
{
    // Eventの作成
    CStreamEvent<CTopicMessage>* event = new CStreamEvent<CTopicMessage>(myEVT_THREAD_STREAM_CH_UPDATE);
    CTopicMessage* log = new CTopicMessage();
    log->setServiceId(m_connectionId);
    log->setTopic(message.m_body);
    log->setChannelName(message.m_channel);
    log->setUserName(message.m_username);
    event->setServiceLog(log);
    return event;
}
Ejemplo n.º 4
0
TEST(MessageTest, Topic) {
	CTopicMessage msg;
	msg.Parse(":nick TOPIC #chan :topic");
	EXPECT_EQ("nick", msg.GetNick().GetNick());
	EXPECT_EQ("TOPIC", msg.GetCommand());
	EXPECT_EQ("#chan", msg.GetTarget());
	EXPECT_EQ("topic", msg.GetTopic());
	EXPECT_EQ(CMessage::Type::Topic, msg.GetType());

	msg.SetTopic("test");
	EXPECT_EQ("test", msg.GetTopic());
	EXPECT_EQ(":nick TOPIC #chan :test", msg.ToString());
}
Ejemplo n.º 5
0
bool CClient::OnTopicMessage(CTopicMessage& Message)
{
	bool bReturn = false;
	CString sChan = Message.GetTarget();
	CString sTopic = Message.GetTopic();

	if (!sTopic.empty()) {
		NETWORKMODULECALL(OnUserTopicMessage(Message), m_pUser, m_pNetwork, this, &bReturn);
	} else {
		NETWORKMODULECALL(OnUserTopicRequest(sChan), m_pUser, m_pNetwork, this, &bReturn);
		Message.SetTarget(sChan);
	}

	return bReturn;
}
Ejemplo n.º 6
0
bool CIRCSock::OnTopicMessage(CTopicMessage& Message) {
    const CNick& Nick = Message.GetNick();
    CChan* pChan = m_pNetwork->FindChan(Message.GetParam(0));

    if (pChan) {
        Message.SetChan(pChan);
        bool bReturn = false;
        IRCSOCKMODULECALL(OnTopicMessage(Message), &bReturn);
        if (bReturn) return true;

        pChan->SetTopicOwner(Nick.GetNick());
        pChan->SetTopicDate((unsigned long)time(nullptr));
        pChan->SetTopic(Message.GetTopic());
    }

    return (pChan && pChan->IsDetached());
}
Ejemplo n.º 7
0
	EModRet OnTopicMessage(CTopicMessage& msg) override { vsHooks.push_back("OnTopicMessage"); vsMessages.push_back(msg.ToString()); vNetworks.push_back(msg.GetNetwork()); vChannels.push_back(msg.GetChan()); return eAction; }