Exemplo n.º 1
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());
}
Exemplo n.º 2
0
bool CClient::OnTopicMessage(CTopicMessage& Message) {
    bool bReturn = false;
    CString sChan = Message.GetTarget();
    CString sTopic = Message.GetTopic();
    if (m_pNetwork) {
        // May be nullptr.
        Message.SetChan(m_pNetwork->FindChan(sChan));
    }

    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;
}