예제 #1
0
파일: CChat.cpp 프로젝트: bucketyied/Source
void CChatMember::RenameChannel(LPCTSTR pszName)
{
	ADDTOCALLSTACK("CChatMember::RenameChannel");
	CChatChannel *pChannel = GetChannel();
	if ( !pChannel )
		SendChatMsg(CHATMSG_MustBeInAConference);
	else if ( !pChannel->IsModerator(GetChatName()) )
		SendChatMsg(CHATMSG_MustHaveOps);
	else
		pChannel->RenameChannel(this, pszName);
}
예제 #2
0
void CChatChanMember::SetChatActive()
{
	ADDTOCALLSTACK("CChatChanMember::SetChatActive");
	// called from Event_ChatButton
	if ( IsChatActive() )
		return;

	CClient * pClient = GetClient();
	if ( pClient )
	{
		m_fChatActive = true;

		// Tell the client to open the chat window dialog
		pClient->addChatSystemMessage( CHATMSG_OpenChatWindow, GetChatName() );

		// Send all existing channel names to this client
		const CChatChannel *pChannel = g_Serv.m_Chats.GetFirstChannel();
		for ( ; pChannel != NULL; pChannel = pChannel->GetNext() )
		{
			pClient->addChatSystemMessage(CHATMSG_SendChannelName, pChannel->GetName(), pChannel->GetModeString());
		}
	}
}
예제 #3
0
파일: CChat.cpp 프로젝트: bucketyied/Source
void CChatMember::addChatWindow()
{
	ADDTOCALLSTACK("CChatMember::addChatWindow");
	// Called from Event_ChatButton

	CClient *pClient = GetClient();
	if ( !pClient || (!pClient->m_UseNewChatSystem && m_bChatActive) )
		return;

	// Open chat window (old chat system only)
	// On new chat system this is not needed because the chat button is hardcoded on client-side, and
	// PacketChatButton packet is sent by client after login complete only to get initial channel list
	if ( !pClient->m_UseNewChatSystem )
		pClient->addChatSystemMessage(CHATCMD_OpenChatWindow, GetChatName());

	// Send channel names
	for ( CChatChannel *pChannel = static_cast<CChatChannel *>(g_Serv.m_Chats.m_Channels.GetHead()); pChannel != NULL; pChannel = pChannel->GetNext() )
	{
		pClient->addChatSystemMessage(CHATCMD_AddChannel, pChannel->m_sName, pClient->m_UseNewChatSystem ? NULL : pChannel->GetPasswordString());
		if ( (g_Cfg.m_iChatFlags & CHATF_AUTOJOIN) && pChannel->m_bStatic && !GetChannel() )
			g_Serv.m_Chats.JoinChannel(pChannel->m_sName, NULL, this);
	}
}