예제 #1
0
파일: ChatInput.cpp 프로젝트: chaosren/HHHH
void PrivateChatInput::OnCustomViewOrtherButtonClick(NDUICustomView* customView, unsigned int ortherButtonIndex, int ortherButtonTag)
{
	/*
	if (ortherButtonIndex == 0) 
	{
		//发送
		std::string msg = FilterMessage(this->GetEditText(0));
		std::string localMsg;
		//localMsg.append("【To】");
		//localMsg.append(this->GetEditText(1));
		localMsg.append(NDPlayer::defaultHero().m_name);
		localMsg.append(":");
		//localMsg.append(msg);
		Chat::DefaultChat()->AddMessage(ChatTypeSecret, msg.c_str(), localMsg.c_str());
		SendChatDataToServer(ChatTypeSecret, msg.c_str(), this->GetEditText(1).c_str());				
		Hide();
	}
	else */if (ortherButtonIndex == 0)
	{
		//插入表情
		ShowExpressions();			
	}
	else if (ortherButtonIndex == 1)
	{
		//插入物品
		ShowItems();
	}
	else if (ortherButtonIndex == 2)
	{
		//从好友列表添加
		ShowFriends();		
	}
}
예제 #2
0
//You can add a friend without a IP to allow the IRC to trade links with lowID users.
bool CFriendList::AddFriend(const uchar* abyUserhash, uint32 dwLastSeen, uint32 dwLastUsedIP, uint16 nLastUsedPort, 
							uint32 dwLastChatted, LPCTSTR pszName, uint32 dwHasHash){
	// client must have an IP (HighID) or a hash
	// TODO: check if this can be switched to a hybridID so clients with *.*.*.0 can be added..
	if (IsLowID(dwLastUsedIP) && dwHasHash==0)
		return false;
	if (SearchFriend(abyUserhash, dwLastUsedIP, nLastUsedPort) != NULL)
		return false;
	CFriend* Record = new CFriend( abyUserhash, dwLastSeen, dwLastUsedIP, nLastUsedPort, dwLastChatted, pszName, dwHasHash );
	m_listFriends.AddTail(Record);
	ShowFriends();
	SaveList();

	// Mighty Knife: log friend activities
	if (thePrefs.GetLogFriendlistActivities ()) {
		#ifdef MIGHTY_TWEAKS
 	    AddLogLine(false, GetResString(IDS_NEWFRIEND)+_T(" '%s', ip %i.%i.%i.%i:%i, ")+GetResString(IDS_CD_UHASH)+_T(" %s"),
									Record->m_strName, (uint8)Record->m_dwLastUsedIP, (uint8)(Record->m_dwLastUsedIP>>8), 
									(uint8)(Record->m_dwLastUsedIP>>16),(uint8)(Record->m_dwLastUsedIP>>24), 
									Record->m_nLastUsedPort, md4str(Record->m_abyUserhash));
		#else
		AddLogLine(false, GetResString(IDS_NEWFRIEND)+_T(" '%s', ")+GetResString(IDS_CD_UHASH)+_T(" %s"),
									Record->m_strName, md4str(Record->m_abyUserhash));
		#endif
	}
예제 #3
0
//You can add a friend without a IP to allow the IRC to trade links with lowID users.
bool CFriendList::AddFriend(const uchar* abyUserhash, uint32 dwLastSeen, uint32 dwLastUsedIP, uint16 nLastUsedPort, 
							uint32 dwLastChatted, LPCTSTR pszName, uint32 dwHasHash){
	// client must have an IP (HighID) or a hash
	// TODO: check if this can be switched to a hybridID so clients with *.*.*.0 can be added..
	if (IsLowID(dwLastUsedIP) && dwHasHash==0)
		return false;
	if( dwLastUsedIP && IsAlreadyFriend(dwLastUsedIP, nLastUsedPort))
		return false;
	CFriend* Record = new CFriend( abyUserhash, dwLastSeen, dwLastUsedIP, nLastUsedPort, dwLastChatted, pszName, dwHasHash );
	m_listFriends.AddTail(Record);
	ShowFriends();
	SaveList();
	return true;
}