//	TAccountXmpp::ITreeItem::TreeItem_EDoMenuAction()
EMenuAction
TAccountXmpp::TreeItem_EDoMenuAction(EMenuAction eMenuAction)
	{
	switch (eMenuAction)
		{
	case eMenuAction_AccountReconnect:
		if (m_paSocket != NULL)
			m_paSocket->Socket_Disconnect();	// Force a hard-reconnection
		Socket_ReconnectIfDisconnected();
		return ezMenuActionNone;
	case eMenuAction_AccountProperties:
		DisplayDialogProperties();
		return ezMenuActionNone;
	case eMenuAction_AccountDelete:
		TreeItemAccount_DeleteFromNavigationTree_MB(PA_DELETING);
		return ezMenuActionNone;
	case eMenuSpecialAction_ITreeItemRenamed:
		// When an account is renamed, we must repopulate the Chat Logs of every contact to display the new nickname
		ChatLog_ResetNickname();
		m_arraypaContacts.ForEach_ChatLogResetNickNameAndRepopulateAllEvents();
		return ezMenuActionNone;
	default:
		return ITreeItem::TreeItem_EDoMenuAction(eMenuAction);
		} // switch
	} // TreeItem_EDoMenuAction()
Exemple #2
0
//	TContact::ITreeItem::TreeItem_EDoMenuAction()
EMenuAction
TContact::TreeItem_EDoMenuAction(EMenuAction eMenuAction)
	{
	const int iGroup = eMenuAction - eMenuSpecialAction_GroupFirst;
	if (iGroup >= 0)
		{
		Contact_AddToGroup(iGroup);
		return ezMenuActionNone;
		}
	switch (eMenuAction)
		{
	case eMenuAction_GroupNew:
		Contact_AddToGroup(iGroup);	// Any out of range value will create a new group
		return ezMenuActionNone;
	case eMenuAction_ContactInvite:
		ChatLog_PwGetLayout_NZ()->WidgetContactInvitation_Show();
		//MessageLog_AppendTextFormatCo(d_coBlack, "eMenuAction_ContactInvite\n");
		return ezMenuActionNone;
	case eMenuAction_ContactSendFile:
		DisplayDialogSendFile();
		return ezMenuActionNone;
	case eMenuAction_ContactRemove:
		TreeItemContact_DeleteFromNavigationTree_MB();
		return ezMenuActionNone;
	case eMenuAction_ContactUndelete:
		TreeItemW_RemoveFromNavigationTree();			// Remove the contact from the 'deleted items'
		TreeItemContact_DisplayWithinNavigationTreeAndClearInvisibleFlag();	// Display the contact with the other contacts
		TreeItemW_SelectWithinNavigationTreeExpanded();
		return ezMenuActionNone;
	case eMenuAction_ContactApprove:
		m_uFlagsContact &= ~FC_kfContactUnsolicited;
		TreeItemContact_UpdateIcon();		// Remove the gray color
		return ezMenuActionNone;
	case eMenuAction_ContactSubscribe:
		m_pAccount->Contact_RosterSubscribe(this);
		return ezMenuActionNone;
	case eMenuAction_ContactUnsubscribe:
		m_pAccount->Contact_RosterUnsubscribe(this);
		return ezMenuActionNone;
	case eMenuAction_ContactPing:
		Xmpp_Ping();
		return ezMenuActionNone;
	case eMenuAction_ContactProperties:
		DisplayDialogProperties();
		return ezMenuActionNone;
	case eMenuAction_Contact_SubMenuView_Transactions:
		TreeItemW_DisplayTransactionsBitcoin();
		return ezMenuActionNone;
	case eMenuAction_Contact_SubMenuView_Recommendations:
		XcpApi_Invoke_RecommendationsGet();
		if (!m_binXmlRecommendations.FIsEmptyBinary())
			Contact_RecommendationsDisplayWithinNavigationTree(TRUE);
		return ezMenuActionNone;
	case eMenuSpecialAction_ITreeItemRenamed:
		TreeItemContact_GenerateDisplayNameFromJid();
		TreeItemContact_UpdateNameDisplayOfAliases();
		goto Default;
	default:
		Default:
		return ITreeItemChatLogEvents::TreeItem_EDoMenuAction(eMenuAction);
		} // switch
	} // TreeItem_EDoMenuAction()