diff options
-rw-r--r-- | plugins/ExternalAPI/delphi/m_variables.inc | 48 | ||||
-rw-r--r-- | plugins/ExternalAPI/m_variables.h | 64 | ||||
-rw-r--r-- | plugins/Variables/src/contact.cpp | 8 | ||||
-rw-r--r-- | plugins/Variables/src/contact.h | 41 |
4 files changed, 41 insertions, 120 deletions
diff --git a/plugins/ExternalAPI/delphi/m_variables.inc b/plugins/ExternalAPI/delphi/m_variables.inc index 4d36c96d35..bcc1f9889f 100644 --- a/plugins/ExternalAPI/delphi/m_variables.inc +++ b/plugins/ExternalAPI/delphi/m_variables.inc @@ -386,52 +386,4 @@ const CallService(MS_VARS_SHOWHELP, (WPARAM)hwndEdit, (LPARAM)"some initial text");
}
-// --------------------------------------------------------------------------
-// Retrieve a contact's HANDLE given a string
-// --------------------------------------------------------------------------
-
- MS_VARS_GETCONTACTFROMSTRING:PAnsiChar = 'Vars/GetContactFromString';
-{
- Searching for contacts in the database. You can find contacts in db by
- searching for their name, e.g first name.
-
- Parameters:
- ------------------------
- wParam = (WPARAM)(CONTACTSINFO *)&ci
- See below.
- lParam = 0
-
- Return Value:
- ------------------------
- Returns number of contacts found matching the given string representation.
- The hContacts array of CONTACTSINFO struct contains these hContacts after
- the call.
-
- Note: The hContacts array needs to be freed after use using mir_free.
-}
-
-type
- TCONTACTSINFO = record
- cbSize :int; // Set this to sizeof(CONTACTSINFO).
- szContact:TCHAR; // String to search for, e.g. last name (can't be NULL).
- hContacts:^THANDLE; // (output) Array of contacts found.
- flags :DWORD; // Contact details that will be matched with the search
- // string (flags can be combined).
- end;
-
-const
-// Possible flags:
- CI_PROTOID = $00000001; // The contact in the string is encoded in the
- // format <PROTOID:UNIQUEID>, e.g. <ICQ:12345678>.
- CI_NICK = $00000002; // Search nick names.
- CI_LISTNAME = $00000004; // Search custom names shown in contact list.
- CI_FIRSTNAME = $00000008; // Search contact's first names (contact details).
- CI_LASTNAME = $00000010; // Search contact's last names (contact details).
- CI_EMAIL = $00000020; // Search contact's email adresses (contact details).
- CI_UNIQUEID = $00000040; // Search unique ids of the contac, e.g. UIN.
- CI_CNFINFO = $40000000; // Searches one of the CNF_* flags (set flags to
- // CI_CNFINFO|CNF_X), only one CNF_ type possible
- CI_UNICODE = $80000000; // tszContact is a unicode string (WCHAR*).
- CI_TCHAR = CI_UNICODE; // Strings in structure are TCHAR*.
-
{$ENDIF}
diff --git a/plugins/ExternalAPI/m_variables.h b/plugins/ExternalAPI/m_variables.h index 6e78025881..701ad423f7 100644 --- a/plugins/ExternalAPI/m_variables.h +++ b/plugins/ExternalAPI/m_variables.h @@ -555,7 +555,6 @@ __inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) { }
#endif
-
#define MS_VARS_SHOWHELP "Vars/ShowHelp"
// WARNING: This service is obsolete, please use MS_VARS_SHOWHELPEX
@@ -586,68 +585,5 @@ __inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) { // Example:
// CallService(MS_VARS_SHOWHELP, (WPARAM)hwndEdit, (LPARAM)"some initial text");
-// --------------------------------------------------------------------------
-// Retrieve a contact's HANDLE given a string
-// --------------------------------------------------------------------------
-
-#define MS_VARS_GETCONTACTFROMSTRING "Vars/GetContactFromString"
-
-// Searching for contacts in the database. You can find contacts in db by
-// searching for their name, e.g first name.
-
-// Parameters:
-// ------------------------
-// wParam = (WPARAM)(CONTACTSINFO *)&ci
-// See below.
-// lParam = 0
-
-// Return Value:
-// ------------------------
-// Returns number of contacts found matching the given string representation.
-// The hContacts array of CONTACTSINFO struct contains these hContacts after
-// the call.
-
-// Note: The hContacts array needs to be freed after use using mir_free
-
-typedef struct {
- int cbSize; // Set this to sizeof(CONTACTSINFO).
- union {
- char *szContact; // String to search for, e.g. last name (can't be NULL).
- WCHAR *wszContact;
- TCHAR *tszContact;
- };
- HANDLE *hContacts; // (output) Array of contacts found.
- DWORD flags; // Contact details that will be matched with the search
- // string (flags can be combined).
-} CONTACTSINFO;
-
-// Possible flags:
-#define CI_PROTOID 0x00000001 // The contact in the string is encoded
- // in the format <PROTOID:UNIQUEID>, e.g.
- // <ICQ:12345678>.
-#define CI_NICK 0x00000002 // Search nick names.
-#define CI_LISTNAME 0x00000004 // Search custom names shown in contact
- // list.
-#define CI_FIRSTNAME 0x00000008 // Search contact's first names (contact
- // details).
-#define CI_LASTNAME 0x00000010 // Search contact's last names (contact
- // details).
-#define CI_EMAIL 0x00000020 // Search contact's email adresses
- // (contact details).
-#define CI_UNIQUEID 0x00000040 // Search unique ids of the contac, e.g.
- // UIN.
-#define CI_CNFINFO 0x40000000 // Searches one of the CNF_* flags (set
- // flags to CI_CNFINFO|CNF_X), only one
- // CNF_ type possible
-#define CI_UNICODE 0x80000000 // tszContact is a unicode string
- // (WCHAR*).
-
-#if defined(UNICODE) || defined(_UNICODE)
-#define CI_TCHAR CI_UNICODE // Strings in structure are TCHAR*.
-#else
-#define CI_TCHAR 0
-#endif
-
-
#endif //__M_VARS
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 0c5619c548..be07a9d47a 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -85,7 +85,6 @@ static int cacheSize = 0; static CRITICAL_SECTION csContactCache;
static HANDLE hContactSettingChangedHook;
-static HANDLE hGetContactFromStringService;
/*
converts a string into a CNF_ type
@@ -395,22 +394,15 @@ static int contactSettingChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-static INT_PTR getContactFromStringSvc( WPARAM wParam, LPARAM lParam)
-{
- return getContactFromString(( CONTACTSINFO* )wParam );
-}
-
int initContactModule()
{
InitializeCriticalSection(&csContactCache);
hContactSettingChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, contactSettingChanged);
- hGetContactFromStringService = CreateServiceFunction(MS_VARS_GETCONTACTFROMSTRING, getContactFromStringSvc);
return 0;
}
int deinitContactModule()
{
- DestroyServiceFunction(hGetContactFromStringService);
UnhookEvent(hContactSettingChangedHook);
DeleteCriticalSection(&csContactCache);
return 0;
diff --git a/plugins/Variables/src/contact.h b/plugins/Variables/src/contact.h index 7d980801f3..3a9b456d27 100644 --- a/plugins/Variables/src/contact.h +++ b/plugins/Variables/src/contact.h @@ -74,5 +74,46 @@ #define PROTOID_HANDLE "_HANDLE_"
+// Note: The hContacts array needs to be freed after use using mir_free
+
+typedef struct {
+ int cbSize; // Set this to sizeof(CONTACTSINFO).
+ union {
+ char *szContact; // String to search for, e.g. last name (can't be NULL).
+ WCHAR *wszContact;
+ TCHAR *tszContact;
+ };
+ HANDLE *hContacts; // (output) Array of contacts found.
+ DWORD flags; // Contact details that will be matched with the search
+ // string (flags can be combined).
+} CONTACTSINFO;
+
+// Possible flags:
+#define CI_PROTOID 0x00000001 // The contact in the string is encoded
+ // in the format <PROTOID:UNIQUEID>, e.g.
+ // <ICQ:12345678>.
+#define CI_NICK 0x00000002 // Search nick names.
+#define CI_LISTNAME 0x00000004 // Search custom names shown in contact
+ // list.
+#define CI_FIRSTNAME 0x00000008 // Search contact's first names (contact
+ // details).
+#define CI_LASTNAME 0x00000010 // Search contact's last names (contact
+ // details).
+#define CI_EMAIL 0x00000020 // Search contact's email adresses
+ // (contact details).
+#define CI_UNIQUEID 0x00000040 // Search unique ids of the contac, e.g.
+ // UIN.
+#define CI_CNFINFO 0x40000000 // Searches one of the CNF_* flags (set
+ // flags to CI_CNFINFO|CNF_X), only one
+ // CNF_ type possible
+#define CI_UNICODE 0x80000000 // tszContact is a unicode string
+ // (WCHAR*).
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define CI_TCHAR CI_UNICODE // Strings in structure are TCHAR*.
+#else
+#define CI_TCHAR 0
+#endif
+
TCHAR *encodeContactToString(HANDLE hContact);
HANDLE *decodeContactFromString(TCHAR *tszContact);
|