diff options
author | George Hazan <george.hazan@gmail.com> | 2012-05-30 17:40:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-05-30 17:40:55 +0000 |
commit | 92874115e64ad763e9f56aa2a9f052deb1e8245d (patch) | |
tree | 5df7bc83c014d95331f3adccef1e92d1c02f5b8f /protocols/IcqOscarJ | |
parent | 88708cffa15662dcd2755fce699112d24a10a087 (diff) |
another minor sync
git-svn-id: http://svn.miranda-ng.org/main/trunk@239 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r-- | protocols/IcqOscarJ/icq_constants.h | 1 | ||||
-rw-r--r-- | protocols/IcqOscarJ/icq_menu.cpp | 36 | ||||
-rw-r--r-- | protocols/IcqOscarJ/icq_proto.h | 1 |
3 files changed, 33 insertions, 5 deletions
diff --git a/protocols/IcqOscarJ/icq_constants.h b/protocols/IcqOscarJ/icq_constants.h index 2b38866bdd..acb5de9ad3 100644 --- a/protocols/IcqOscarJ/icq_constants.h +++ b/protocols/IcqOscarJ/icq_constants.h @@ -55,6 +55,7 @@ #define ICMI_AUTH_REVOKE 2
#define ICMI_ADD_TO_SERVLIST 3
#define ICMI_XSTATUS_DETAILS 4
+#define ICMI_OPEN_PROFILE 5
/* Some default settings */
#define DEFAULT_SERVER_PORT 5190
diff --git a/protocols/IcqOscarJ/icq_menu.cpp b/protocols/IcqOscarJ/icq_menu.cpp index d576856b32..46da48ad1a 100644 --- a/protocols/IcqOscarJ/icq_menu.cpp +++ b/protocols/IcqOscarJ/icq_menu.cpp @@ -38,8 +38,8 @@ static HANDLE hPrebuildMenuHook;
-HANDLE g_hContactMenuItems[5];
-HANDLE g_hContactMenuSvc[5];
+HANDLE g_hContactMenuItems[6];
+HANDLE g_hContactMenuSvc[6];
static int sttCompareProtocols(const CIcqProto *p1, const CIcqProto *p2)
{
@@ -91,6 +91,12 @@ static INT_PTR IcqMenuHandleXStatusDetails(WPARAM wParam, LPARAM lParam) return (ppro) ? ppro->ShowXStatusDetails(wParam, lParam) : 0;
}
+static INT_PTR IcqMenuHandleOpenProfile(WPARAM wParam, LPARAM lParam)
+{
+ CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ return (ppro) ? ppro->OpenWebProfile(wParam, lParam) : 0;
+}
+
static void sttEnableMenuItem( HANDLE hMenuItem, bool bEnable )
{
CLISTMENUITEM clmi = {0};
@@ -109,7 +115,8 @@ static int IcqPrebuildContactMenu( WPARAM wParam, LPARAM lParam ) sttEnableMenuItem(g_hContactMenuItems[ICMI_AUTH_REVOKE], FALSE);
sttEnableMenuItem(g_hContactMenuItems[ICMI_ADD_TO_SERVLIST], FALSE);
sttEnableMenuItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], FALSE);
-
+ sttEnableMenuItem(g_hContactMenuItems[ICMI_OPEN_PROFILE], FALSE);
+
CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
return (ppro) ? ppro->OnPreBuildContactMenu(wParam, lParam) : 0;
}
@@ -170,6 +177,13 @@ void g_MenuInit(void) strcpy(pszDest, MS_XSTATUS_SHOWDETAILS);
g_hContactMenuItems[ICMI_XSTATUS_DETAILS] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
g_hContactMenuSvc[ICMI_XSTATUS_DETAILS] = CreateServiceFunction(mi.pszService, IcqMenuHandleXStatusDetails);
+
+ // "Open ICQ profile"
+ mi.pszName = LPGEN("Open ICQ profile");
+ mi.position = 1000029997;
+ strcpy(pszDest, MS_OPEN_PROFILE);
+ g_hContactMenuItems[ICMI_OPEN_PROFILE] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuSvc[ICMI_OPEN_PROFILE] = CreateServiceFunction(mi.pszService, IcqMenuHandleOpenProfile);
}
void g_MenuUninit(void)
@@ -181,15 +195,27 @@ void g_MenuUninit(void) CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)g_hContactMenuItems[ICMI_AUTH_REVOKE], 0);
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)g_hContactMenuItems[ICMI_ADD_TO_SERVLIST], 0);
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)g_hContactMenuItems[ICMI_XSTATUS_DETAILS], 0);
+ CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)g_hContactMenuItems[ICMI_OPEN_PROFILE], 0);
DestroyServiceFunction(g_hContactMenuSvc[ICMI_AUTH_REQUEST]);
DestroyServiceFunction(g_hContactMenuSvc[ICMI_AUTH_GRANT]);
DestroyServiceFunction(g_hContactMenuSvc[ICMI_AUTH_REVOKE]);
DestroyServiceFunction(g_hContactMenuSvc[ICMI_ADD_TO_SERVLIST]);
DestroyServiceFunction(g_hContactMenuSvc[ICMI_XSTATUS_DETAILS]);
+ DestroyServiceFunction(g_hContactMenuSvc[ICMI_OPEN_PROFILE]);
+}
+
+INT_PTR CIcqProto::OpenWebProfile(WPARAM wParam, LPARAM lParam)
+{
+ HANDLE hContact = (HANDLE)wParam;
+ DWORD dwUin = getContactUin(hContact);
+ char url[256];
+ mir_snprintf(url, sizeof(url), "http://www.icq.com/people/%d",dwUin);
+ return CallService(MS_UTILS_OPENURL, 1, (LPARAM)url);
}
+
int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM)
{
HANDLE hContact = (HANDLE)wParam;
@@ -208,13 +234,13 @@ int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM) sttEnableMenuItem(g_hContactMenuItems[ICMI_AUTH_GRANT], dwUin && (bCtrlPressed || getSettingByte((HANDLE)wParam, "Grant", 0)));
sttEnableMenuItem(g_hContactMenuItems[ICMI_AUTH_REVOKE],
dwUin && (bCtrlPressed || (getSettingByte(NULL, "PrivacyItems", 0) && !getSettingByte((HANDLE)wParam, "Grant", 0))));
-
sttEnableMenuItem(g_hContactMenuItems[ICMI_ADD_TO_SERVLIST],
m_bSsiEnabled && !getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) &&
!getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0) &&
!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0));
}
-
+
+ sttEnableMenuItem(g_hContactMenuItems[ICMI_OPEN_PROFILE],getContactUin(hContact));
BYTE bXStatus = getContactXStatus((HANDLE)wParam);
sttEnableMenuItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], m_bHideXStatusUI ? 0 : bXStatus != 0);
diff --git a/protocols/IcqOscarJ/icq_proto.h b/protocols/IcqOscarJ/icq_proto.h index cbb149eacc..ef33b456f6 100644 --- a/protocols/IcqOscarJ/icq_proto.h +++ b/protocols/IcqOscarJ/icq_proto.h @@ -134,6 +134,7 @@ struct CIcqProto : public PROTO_INTERFACE INT_PTR __cdecl GetXStatusIcon(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GrantAuthorization(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl menuXStatus(WPARAM wParam,LPARAM lParam,LPARAM fParam);
+ INT_PTR __cdecl OpenWebProfile(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl RecvAuth(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl RequestAdvStatusIconIdx(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl RequestAuthorization(WPARAM wParam, LPARAM lParam);
|