summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp3
-rw-r--r--plugins/Clist_mw/src/clcitems.cpp4
-rw-r--r--plugins/Db3x_mmap/src/dbevents.cpp2
-rw-r--r--plugins/FingerprintNG/src/fingerprint.cpp2
-rw-r--r--plugins/HistoryPlusPlus/EmptyHistoryForm.pas20
-rw-r--r--plugins/HistoryPlusPlus/GlobalSearch.pas4
-rw-r--r--plugins/HistoryPlusPlus/HistoryForm.pas12
-rw-r--r--plugins/HistoryPlusPlus/hpp_contacts.pas45
-rw-r--r--plugins/HistoryPlusPlus/hpp_externalgrid.pas8
-rw-r--r--plugins/HistoryStats/src/dlgoption_subinput.cpp12
-rw-r--r--plugins/HistoryStats/src/mirandahistory.cpp6
-rw-r--r--plugins/HistoryStats/src/mu_common.cpp22
-rw-r--r--plugins/HistoryStats/src/mu_common.h11
-rw-r--r--plugins/MenuItemEx/src/main.cpp9
-rw-r--r--plugins/MirFox/src/MirandaUtils.cpp2
-rw-r--r--plugins/MirandaG15/src/CContactList.cpp17
-rwxr-xr-xplugins/New_GPG/src/main.cpp8
-rw-r--r--plugins/New_GPG/src/metacontacts.cpp16
-rw-r--r--plugins/New_GPG/src/metacontacts.h4
-rwxr-xr-xplugins/New_GPG/src/options.cpp36
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp4
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp2
-rw-r--r--plugins/SecureIM/src/crypt_metacontacts.cpp6
-rw-r--r--plugins/TabSRMM/src/container.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp2
-rw-r--r--plugins/TipperYM/src/subst.cpp6
-rw-r--r--plugins/UserInfoEx/src/classMAnnivDate.cpp14
-rw-r--r--plugins/UserInfoEx/src/dlg_propsheet.cpp8
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp8
-rw-r--r--plugins/UserInfoEx/src/mir_db.cpp46
-rw-r--r--plugins/UserInfoEx/src/mir_db.h8
-rw-r--r--plugins/UserInfoEx/src/psp_profile.cpp13
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp2
-rw-r--r--plugins/Variables/src/parse_metacontacts.cpp2
36 files changed, 141 insertions, 236 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index efeb4278c5..6cd90055ba 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -392,8 +392,7 @@ static LRESULT clcOnCreate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPA
dat->needsResort = 1;
dat->MetaIgnoreEmptyExtra = db_get_b(NULL, "CLC", "MetaIgnoreEmptyExtra", SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
- dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd, GWL_STYLE)&CLS_MANUALUPDATE)) &&
- db_get_b(NULL, META_PROTO, "Enabled", 1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
+ dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd, GWL_STYLE)&CLS_MANUALUPDATE)) && db_get_b(NULL, META_PROTO, "Enabled", 1);
dat->expandMeta = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
dat->useMetaIcon = db_get_b(NULL, "CLC", "Meta", SETTING_USEMETAICON_DEFAULT);
@@ -1288,7 +1287,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
mir_sntprintf(Wording, SIZEOF(Wording), TranslateT("Do you want contact '%s' to be default?"), contSour->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Set default contact"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1)
- CallService(MS_MC_SETDEFAULTCONTACT, (WPARAM)contDest->hContact, (LPARAM)hsour);
+ db_mc_setDefault(contDest->hContact, hsour);
}
else {
MCONTACT hcontact = contSour->hContact;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 029856fada..201ca360c1 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -32,7 +32,7 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
{
ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(cont->hContact);
cont->SubExpanded = ( db_get_b(cont->hContact,"CList","Expanded",0) && ( db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT)));
- int subcount = (int)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)cont->hContact,0);
+ int subcount = db_mc_getSubCount(cont->hContact);
if (subcount <= 0) {
cont->isSubcontact = 0;
cont->subcontacts = NULL;
@@ -46,7 +46,7 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
cont->SubAllocated = subcount;
int i=0;
for (int j = 0; j < subcount; j++) {
- MCONTACT hsub = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)cont->hContact, j);
+ MCONTACT hsub = db_mc_getSub(cont->hContact, j);
cacheEntry = pcli->pfnGetCacheEntry(hsub);
WORD wStatus = pdnce___GetStatus(cacheEntry);
if (showOfflineHereGroup || (!( db_get_b(NULL,"CLC","MetaHideOfflineSub",SETTING_METAHIDEOFFLINESUB_DEFAULT) && db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT))
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 031f051d92..11b4374f22 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -748,8 +748,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat )
dat->selTextColour = db_get_dw(NULL,"CLC","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
dat->hotTextColour = db_get_dw(NULL,"CLC","HotTextColour",CLCDEFAULT_MODERN_HOTTEXTCOLOUR);
dat->quickSearchColour = db_get_dw(NULL,"CLC","QuickSearchColour",CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR);
- dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
- db_get_b(NULL, META_PROTO, "Enabled", 1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
+ dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) && db_get_b(NULL, META_PROTO, "Enabled", 1);
if (pcli->hwndContactTree == NULL || dat->hWnd == pcli->hwndContactTree)
dat->MetaIgnoreEmptyExtra = db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp
index 703ae72ad4..2965d4fa7b 100644
--- a/plugins/Clist_mw/src/clcitems.cpp
+++ b/plugins/Clist_mw/src/clcitems.cpp
@@ -44,14 +44,14 @@ void AddSubcontacts(struct ClcContact * cont)
ClcCacheEntry *cacheEntry;
cacheEntry = GetContactFullCacheEntry(cont->hContact);
OutputDebugStringA("Proceed AddSubcontacts\r\n");
- subcount = (int)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)cont->hContact,0);
+ subcount = db_mc_getSubCount(cont->hContact);
cont->SubExpanded = db_get_b(cont->hContact,"CList","Expanded",0);
cont->isSubcontact = 0;
cont->subcontacts = (struct ClcContact *) mir_realloc(cont->subcontacts, sizeof(struct ClcContact)*subcount);
cont->SubAllocated = subcount;
i = 0;
for (j = 0; j<subcount; j++) {
- MCONTACT hsub = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)cont->hContact, j);
+ MCONTACT hsub = db_mc_getSub(cont->hContact, j);
cacheEntry = GetContactFullCacheEntry(hsub);
if ( !(db_get_b(NULL,"CLC","MetaHideOfflineSub",1) && db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) ||
cacheEntry->status != ID_STATUS_OFFLINE )
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp
index 393d6b69e0..9a9672f689 100644
--- a/plugins/Db3x_mmap/src/dbevents.cpp
+++ b/plugins/Db3x_mmap/src/dbevents.cpp
@@ -53,7 +53,7 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
if (cc->IsSub()) {
// set default sub to the event's source
- CallService(MS_MC_SETDEFAULTCONTACT, cc->parentID, contactID);
+ db_mc_setDefault(cc->parentID, contactID);
contactID = cc->parentID; // and add an event to a metahistory
}
}
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp
index 8d41afac4a..30ce9b8cf3 100644
--- a/plugins/FingerprintNG/src/fingerprint.cpp
+++ b/plugins/FingerprintNG/src/fingerprint.cpp
@@ -171,7 +171,7 @@ int __fastcall ApplyFingerprintImage(MCONTACT hContact, LPTSTR szMirVer)
SetSrmmIcon(hContact, szMirVer);
MCONTACT hMeta = db_mc_getMeta(hContact);
- if (hMeta && CallService(MS_MC_GETDEFAULTCONTACT, hMeta, 0) == hContact)
+ if (hMeta && db_mc_getDefault(hMeta) == hContact)
db_set_ts(hMeta, META_PROTO, "MirVer", szMirVer);
return 0;
diff --git a/plugins/HistoryPlusPlus/EmptyHistoryForm.pas b/plugins/HistoryPlusPlus/EmptyHistoryForm.pas
index 39c3ce7ee8..f1faa55e6c 100644
--- a/plugins/HistoryPlusPlus/EmptyHistoryForm.pas
+++ b/plugins/HistoryPlusPlus/EmptyHistoryForm.pas
@@ -64,16 +64,16 @@ type
procedure FormShow(Sender: TObject);
procedure btYesClick(Sender: TObject);
private
- FContact: THandle;
- FContacts: Array of THandle;
+ FContact: TMCONTACT;
+ FContacts: Array of TMCONTACT;
procedure TranslateForm;
procedure PrepareForm;
- procedure SetContact(const Value: THandle);
- procedure EmptyHistory(hContact: THandle);
+ procedure SetContact(const Value: TMCONTACT);
+ procedure EmptyHistory(hContact: TMCONTACT);
protected
function GetFormText: String;
public
- property Contact: THandle read FContact write SetContact;
+ property Contact: TMCONTACT read FContact write SetContact;
end;
implementation
@@ -217,9 +217,9 @@ begin
end;
end;
-procedure TEmptyHistoryFrm.SetContact(const Value: THandle);
+procedure TEmptyHistoryFrm.SetContact(const Value: TMCONTACT);
var
- hContact: THandle;
+ hContact: TMCONTACT;
Proto: AnsiString;
i,num: Integer;
begin
@@ -228,10 +228,10 @@ begin
GetContactProto(FContact,hContact,Proto);
if Value <> hContact then
begin
- num := CallService(MS_MC_GETNUMCONTACTS,FContact,0);
+ num := db_mc_getSubCount(FContact);
for i := 0 to num-1 do
begin
- hContact := CallService(MS_MC_GETSUBCONTACT,FContact,i);
+ hContact := db_mc_getSub(FContact,i);
if hContact <> THandle(-1) then
begin
SetLength(FContacts,Length(FContacts)+1);
@@ -248,7 +248,7 @@ begin
btYes.Default := true;
end;
-procedure TEmptyHistoryFrm.EmptyHistory(hContact: THandle);
+procedure TEmptyHistoryFrm.EmptyHistory(hContact: TMCONTACT);
var
hDBEvent,prevhDbEvent: THandle;
begin
diff --git a/plugins/HistoryPlusPlus/GlobalSearch.pas b/plugins/HistoryPlusPlus/GlobalSearch.pas
index a51daf10f0..aa8db4368d 100644
--- a/plugins/HistoryPlusPlus/GlobalSearch.pas
+++ b/plugins/HistoryPlusPlus/GlobalSearch.pas
@@ -394,7 +394,7 @@ uses
function TfmGlobalSearch.AddContact(hContact: THandle): THPPContactInfo;
var
ci: THPPContactInfo;
- SubContact: THandle;
+ SubContact: TMCONTACT;
SubProtocol: AnsiString;
begin
ci := THPPContactInfo.Create;
@@ -1779,7 +1779,7 @@ procedure TfmGlobalSearch.HMNickChanged(var M: TMessage);
var
ci: THPPContactInfo;
i: Integer;
- SubContact: THandle;
+ SubContact: TMCONTACT;
SubProtocol: AnsiString;
begin
{ wParam - hContact; lParam - zero }
diff --git a/plugins/HistoryPlusPlus/HistoryForm.pas b/plugins/HistoryPlusPlus/HistoryForm.pas
index a0e1f53b3c..0ce99caf3d 100644
--- a/plugins/HistoryPlusPlus/HistoryForm.pas
+++ b/plugins/HistoryPlusPlus/HistoryForm.pas
@@ -328,7 +328,7 @@ type
DelayedFilter: TMessageTypes;
StartTimestamp: DWord;
EndTimestamp: DWord;
- FhContact, FhSubContact: THandle;
+ FhContact, FhSubContact: TMCONTACT;
FProtocol, FSubProtocol: AnsiString;
SavedLinkUrl: String;
SavedFileDir: String;
@@ -359,7 +359,7 @@ type
procedure OpenDetails(Item: Integer);
procedure TranslateForm;
- procedure SethContact(const Value: THandle);
+ procedure SethContact(const Value: TMCONTACT);
procedure LoadInOptions();
function IsFileEvent(Index: Integer): Boolean;
@@ -432,9 +432,9 @@ type
procedure FillBookmarks;
procedure HMBookmarkChanged(var M: TMessage); message HM_NOTF_BOOKMARKCHANGED;
- property hContact: THandle read FhContact write SethContact;
+ property hContact: TMCONTACT read FhContact write SethContact;
property Protocol: AnsiString read FProtocol;
- property hSubContact: THandle read FhSubContact;
+ property hSubContact: TMCONTACT read FhSubContact;
property SubProtocol: AnsiString read FSubProtocol;
published
procedure AlignControls(Control: TControl; var ARect: TRect); override;
@@ -1062,7 +1062,7 @@ end;
procedure THistoryFrm.HMMetaDefaultChanged(var M: TMessage);
var
- newSubContact: THandle;
+ newSubContact: TMCONTACT;
newSubProtocol: AnsiString;
begin
if THandle(M.wParam) <> hContact then
@@ -3100,7 +3100,7 @@ begin
end;
end;
-procedure THistoryFrm.SethContact(const Value: THandle);
+procedure THistoryFrm.SethContact(const Value: TMCONTACT);
begin
// if FhContact = Value then exit;
FhContact := Value;
diff --git a/plugins/HistoryPlusPlus/hpp_contacts.pas b/plugins/HistoryPlusPlus/hpp_contacts.pas
index d0beee248b..e2a68e7ac3 100644
--- a/plugins/HistoryPlusPlus/hpp_contacts.pas
+++ b/plugins/HistoryPlusPlus/hpp_contacts.pas
@@ -48,29 +48,30 @@ interface
uses
Windows, SysUtils,
Forms,
+ m_api,
hpp_global;
-function GetContactDisplayName(hContact: THandle; Proto: AnsiString = ''; Contact: boolean = false): String;
-function GetContactProto(hContact: THandle): AnsiString; overload;
-function GetContactProto(hContact: THandle; var SubContact: THandle; var SubProtocol: AnsiString): AnsiString; overload;
-function GetContactID(hContact: THandle; Proto: AnsiString = ''; Contact: boolean = false): AnsiString;
-function GetContactCodePage(hContact: THandle; const Proto: AnsiString = ''): Cardinal; overload;
-function GetContactCodePage(hContact: THandle; const Proto: AnsiString; var UsedDefault: boolean): Cardinal; overload;
-function WriteContactCodePage(hContact: THandle; CodePage: Cardinal; Proto: AnsiString = ''): boolean;
-function GetContactRTLMode(hContact: THandle; Proto: AnsiString = ''): boolean;
-function GetContactRTLModeTRTL(hContact: THandle; Proto: AnsiString = ''): TRTLMode;
-function WriteContactRTLMode(hContact: THandle; RTLMode: TRTLMode; Proto: AnsiString = ''): boolean;
+function GetContactDisplayName(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): String;
+function GetContactProto(hContact: TMCONTACT): AnsiString; overload;
+function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: AnsiString): AnsiString; overload;
+function GetContactID(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): AnsiString;
+function GetContactCodePage(hContact: TMCONTACT; const Proto: AnsiString = ''): Cardinal; overload;
+function GetContactCodePage(hContact: TMCONTACT; const Proto: AnsiString; var UsedDefault: boolean): Cardinal; overload;
+function WriteContactCodePage(hContact: TMCONTACT; CodePage: Cardinal; Proto: AnsiString = ''): boolean;
+function GetContactRTLMode(hContact: TMCONTACT; Proto: AnsiString = ''): boolean;
+function GetContactRTLModeTRTL(hContact: TMCONTACT; Proto: AnsiString = ''): TRTLMode;
+function WriteContactRTLMode(hContact: TMCONTACT; RTLMode: TRTLMode; Proto: AnsiString = ''): boolean;
implementation
-uses hpp_database, hpp_options, m_api;
+uses hpp_database, hpp_options;
-function GetContactProto(hContact: THandle): AnsiString;
+function GetContactProto(hContact: TMCONTACT): AnsiString;
begin
Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
end;
-function GetContactProto(hContact: THandle; var SubContact: THandle; var SubProtocol: AnsiString): AnsiString;
+function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: AnsiString): AnsiString;
begin
Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
if (Result = META_PROTO) then
@@ -85,7 +86,7 @@ begin
end;
end;
-function GetContactDisplayName(hContact: THandle; Proto: AnsiString = ''; Contact: boolean = false): String;
+function GetContactDisplayName(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): String;
var
ci: TContactInfo;
RetPWideChar, UW: PChar;
@@ -122,7 +123,7 @@ begin
end;
end;
-function GetContactID(hContact: THandle; Proto: AnsiString = ''; Contact: boolean = false): AnsiString;
+function GetContactID(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): AnsiString;
var
uid: PAnsiChar;
dbv: TDBVARIANT;
@@ -162,7 +163,7 @@ begin
end;
end;
-function WriteContactCodePage(hContact: THandle; CodePage: Cardinal; Proto: AnsiString = ''): boolean;
+function WriteContactCodePage(hContact: TMCONTACT; CodePage: Cardinal; Proto: AnsiString = ''): boolean;
begin
Result := false;
if Proto = '' then
@@ -173,7 +174,7 @@ begin
Result := True;
end;
-function _GetContactCodePage(hContact: THandle; Proto: AnsiString; var UsedDefault: boolean) : Cardinal;
+function _GetContactCodePage(hContact: TMCONTACT; Proto: AnsiString; var UsedDefault: boolean) : Cardinal;
begin
if Proto = '' then
Proto := GetContactProto(hContact);
@@ -190,14 +191,14 @@ begin
end;
end;
-function GetContactCodePage(hContact: THandle; const Proto: AnsiString = ''): Cardinal;
+function GetContactCodePage(hContact: TMCONTACT; const Proto: AnsiString = ''): Cardinal;
var
def: boolean;
begin
Result := _GetContactCodePage(hContact, Proto, def);
end;
-function GetContactCodePage(hContact: THandle; const Proto: AnsiString; var UsedDefault: boolean): Cardinal; overload;
+function GetContactCodePage(hContact: TMCONTACT; const Proto: AnsiString; var UsedDefault: boolean): Cardinal; overload;
begin
Result := _GetContactCodePage(hContact, Proto, UsedDefault);
end;
@@ -206,7 +207,7 @@ end;
// Changed default RTL mode from SysLocale.MiddleEast to
// Application.UseRightToLeftScrollBar because it's more correct and
// doesn't bug on MY SYSTEM!
-function GetContactRTLMode(hContact: THandle; Proto: AnsiString = ''): boolean;
+function GetContactRTLMode(hContact: TMCONTACT; Proto: AnsiString = ''): boolean;
var
Temp: Byte;
begin
@@ -226,7 +227,7 @@ begin
end;
end;
-function WriteContactRTLMode(hContact: THandle; RTLMode: TRTLMode; Proto: AnsiString = ''): boolean;
+function WriteContactRTLMode(hContact: TMCONTACT; RTLMode: TRTLMode; Proto: AnsiString = ''): boolean;
begin
Result := false;
if Proto = '' then
@@ -241,7 +242,7 @@ begin
Result := True;
end;
-function GetContactRTLModeTRTL(hContact: THandle; Proto: AnsiString = ''): TRTLMode;
+function GetContactRTLModeTRTL(hContact: TMCONTACT; Proto: AnsiString = ''): TRTLMode;
var
Temp: Byte;
begin
diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas
index c0ee6c38e5..7001eda5e5 100644
--- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas
+++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas
@@ -93,7 +93,7 @@ type
FGridState: TGridState;
SaveDialog: TSaveDialog;
RecentFormat: TSaveFormat;
- FSubContact: THandle;
+ FSubContact: TMCONTACT;
FSubProtocol: AnsiString;
function GetGridHandle: HWND;
@@ -144,7 +144,7 @@ type
public
constructor Create(AParentWindow: HWND; ControlID: Cardinal = 0);
destructor Destroy; override;
- procedure AddEvent(hContact, hDBEvent: THandle; Codepage: Integer; RTL: Boolean; DoScroll: Boolean);
+ procedure AddEvent(hContact:TMCONTACT; hDBEvent: THandle; Codepage: Integer; RTL: Boolean; DoScroll: Boolean);
procedure AddCustomEvent(hContact: THandle; const CustomItem: TExtCustomItem;
Codepage: Integer; RTL: Boolean; DoScroll: Boolean);
procedure SetPosition(x, y, cx, cy: Integer);
@@ -277,7 +277,7 @@ begin
Result := M.Result;
end;
-procedure TExternalGrid.AddEvent(hContact, hDBEvent: THandle; Codepage: Integer; RTL: Boolean;
+procedure TExternalGrid.AddEvent(hContact:TMCONTACT; hDBEvent: THandle; Codepage: Integer; RTL: Boolean;
DoScroll: Boolean);
var
RTLMode: TRTLMode;
@@ -1110,7 +1110,7 @@ end;
procedure TExternalGrid.HMMetaDefaultChanged(var M: TMessage);
var
- newSubContact: THandle;
+ newSubContact: TMCONTACT;
newSubProtocol: AnsiString;
begin
if Grid.Contact <> M.WParam then
diff --git a/plugins/HistoryStats/src/dlgoption_subinput.cpp b/plugins/HistoryStats/src/dlgoption_subinput.cpp
index 5f808f6b09..351132100a 100644
--- a/plugins/HistoryStats/src/dlgoption_subinput.cpp
+++ b/plugins/HistoryStats/src/dlgoption_subinput.cpp
@@ -78,13 +78,11 @@ void DlgOption::SubInput::onWMInitDialog()
hTemp = m_Options.insertGroup(NULL, TranslateT("Contact filtering"), OptionsCtrl::OCF_ROOTGROUP | OptionsCtrl::OCF_NODISABLECHILDS);
m_hProtocols = m_Options.insertGroup(hTemp, TranslateT("Ignore all contacts with protocol..."));
- if (mu::metacontacts::_available()) {
- hTemp2 = m_Options.insertGroup(hTemp, TranslateT("History read mode for MetaContacts"), mu::metacontacts::_available() ? 0 : OptionsCtrl::OCF_DISABLED);
- m_hMetaContactsMode = m_Options.insertRadio(hTemp2, NULL, TranslateT("Use only meta-contact's history"));
- m_Options.insertRadio(hTemp2, m_hMetaContactsMode, TranslateT("Use only subcontacts' histories (for one meta-contact)"));
- m_Options.insertRadio(hTemp2, m_hMetaContactsMode, TranslateT("Use meta-contact's history and its subcontacts' histories"));
- m_Options.insertRadio(hTemp2, m_hMetaContactsMode, TranslateT("Treat meta-contacts and subcontacts as normal contacts"));
- }
+ hTemp2 = m_Options.insertGroup(hTemp, TranslateT("History read mode for MetaContacts"), 0);
+ m_hMetaContactsMode = m_Options.insertRadio(hTemp2, NULL, TranslateT("Use only meta-contact's history"));
+ m_Options.insertRadio(hTemp2, m_hMetaContactsMode, TranslateT("Use only subcontacts' histories (for one meta-contact)"));
+ m_Options.insertRadio(hTemp2, m_hMetaContactsMode, TranslateT("Use meta-contact's history and its subcontacts' histories"));
+ m_Options.insertRadio(hTemp2, m_hMetaContactsMode, TranslateT("Treat meta-contacts and subcontacts as normal contacts"));
m_hMergeContacts = m_Options.insertCheck(hTemp, TranslateT("Merge contacts with same name"), OptionsCtrl::OCF_DISABLECHILDSONUNCHECK);
m_hMergeContactsGroups = m_Options.insertCheck(m_hMergeContacts, TranslateT("Only merge if contacts are in the same group"));
diff --git a/plugins/HistoryStats/src/mirandahistory.cpp b/plugins/HistoryStats/src/mirandahistory.cpp
index 867b8756f2..60c4df0ba0 100644
--- a/plugins/HistoryStats/src/mirandahistory.cpp
+++ b/plugins/HistoryStats/src/mirandahistory.cpp
@@ -59,7 +59,7 @@ void MirandaHistory::makeContactsAvailable()
void MirandaHistory::readContacts()
{
- bool bHandleMeta = mu::metacontacts::_available() && m_Settings.m_MetaContactsMode != Settings::mcmIgnoreMeta;
+ bool bHandleMeta = m_Settings.m_MetaContactsMode != Settings::mcmIgnoreMeta;
ext::a::string strMetaProto = bHandleMeta ? META_PROTO : "";
MirandaSettings db;
@@ -106,10 +106,10 @@ void MirandaHistory::readContacts()
// include meta-contact's subcontact
if (m_Settings.m_MetaContactsMode != Settings::mcmMetaOnly) {
// find subcontacts to read history from
- int numSubs = mu::metacontacts::getNumContacts(hContact);
+ int numSubs = db_mc_getSubCount(hContact);
if (numSubs > 0) {
for (int i = 0; i < numSubs; ++i) {
- MCONTACT hSubContact = mu::metacontacts::getSubContact(hContact, i);
+ MCONTACT hSubContact = db_mc_getSub(hContact, i);
if (hSubContact)
sources.push_back(hSubContact);
}
diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp
index 1a3d5c199e..0f0bfa7b52 100644
--- a/plugins/HistoryStats/src/mu_common.cpp
+++ b/plugins/HistoryStats/src/mu_common.cpp
@@ -187,28 +187,6 @@ namespace mu
}
/*
- * metacontacts [external]
- */
-
- namespace metacontacts
- {
- bool _available()
- {
- return true;
- }
-
- int getNumContacts(MCONTACT hMetaContact)
- {
- return CallService(MS_MC_GETNUMCONTACTS, hMetaContact, 0);
- }
-
- MCONTACT getSubContact(MCONTACT hMetaContact, int iContactNumber)
- {
- return CallService(MS_MC_GETSUBCONTACT, hMetaContact, iContactNumber);
- }
- }
-
- /*
* opt
*/
diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h
index c599d15f61..8ad005a5f4 100644
--- a/plugins/HistoryStats/src/mu_common.h
+++ b/plugins/HistoryStats/src/mu_common.h
@@ -63,17 +63,6 @@ namespace mu
}
/*
- * metacontacts [external]
- */
-
- namespace metacontacts
- {
- bool _available();
- int getNumContacts(MCONTACT hMetaContact);
- MCONTACT getSubContact(MCONTACT hMetaContact, int iContactNumber);
- }
-
- /*
* opt
*/
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 39d6549624..e0f9f1c1ce 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -268,11 +268,6 @@ BOOL isMetaContact(MCONTACT hContact)
return FALSE;
}
-MCONTACT getDefaultContact(MCONTACT hContact)
-{
- return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, hContact, 0);
-}
-
MCONTACT getMostOnline(MCONTACT hContact)
{
return (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
@@ -512,7 +507,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID)
if (isMetaContact(hContact)) {
MCONTACT hC = getMostOnline(hContact);
- if (!hContact) hC = getDefaultContact(hContact);
+ if (!hContact) hC = db_mc_getDefault(hContact);
hContact = hC;
}
@@ -612,7 +607,7 @@ INT_PTR onCopyID(WPARAM wparam, LPARAM lparam)
if (isMetaContact(hContact)) {
MCONTACT hC = getMostOnline(hContact);
if (!hContact)
- hC = getDefaultContact(hContact);
+ hC = db_mc_getDefault(hContact);
hContact = hC;
}
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp
index 24307322eb..1ae3f43c14 100644
--- a/plugins/MirFox/src/MirandaUtils.cpp
+++ b/plugins/MirFox/src/MirandaUtils.cpp
@@ -148,7 +148,7 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_
//TODO - metacontacts support - C:\MIRANDA\SOURCES\PLUGINS\popup_trunk\src\popup_wnd2.cpp : 1083
// //check for MetaContact and get szProto from subcontact
// if(strcmp(targetHandleSzProto, gszMetaProto)==0) {
- // HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, hContact, 0);
+ // HANDLE hSubContact = db_mc_getDefault(hContact);
// if(!hSubContact) return FALSE;
// targetHandleSzProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hSubContact, 0);
// }
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp
index c9f01b8187..fad2ae47a5 100644
--- a/plugins/MirandaG15/src/CContactList.cpp
+++ b/plugins/MirandaG15/src/CContactList.cpp
@@ -150,10 +150,10 @@ void CContactList::AddContact(MCONTACT hContact)
pGroup->sort(CContactList::CompareEntries);
// check that all subcontacts exist
- int numContacts = CallService(MS_MC_GETNUMCONTACTS,hContact,0);
+ int numContacts = db_mc_getSubCount(hContact);
MCONTACT hSubContact = NULL;
for(int i=0;i<numContacts;i++) {
- hSubContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, hContact, (LPARAM)i);
+ hSubContact = db_mc_getSub(hContact, i);
RemoveContact(hSubContact);
AddContact(hSubContact);
}
@@ -203,13 +203,12 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) {
}
} else {
if(pEntry->iStatus == ID_STATUS_OFFLINE) {
- DWORD dwNumContacts = (DWORD)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)pEntry->hHandle,0);
- for(DWORD i = 0; i < dwNumContacts; i++) {
- MCONTACT hSubContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT,(WPARAM)pEntry->hHandle,i);
+ int dwNumContacts = db_mc_getSubCount(pEntry->hHandle);
+ for(int i = 0; i < dwNumContacts; i++) {
+ MCONTACT hSubContact = db_mc_getSub(pEntry->hHandle,i);
char *szProto = GetContactProto(hSubContact);
- if(db_get_w(hSubContact,szProto,"Status",ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
+ if(db_get_w(hSubContact,szProto,"Status",ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
return true;
- }
}
}
}
@@ -279,9 +278,9 @@ void CContactList::RemoveContact(MCONTACT hContact) {
else {
pGroup->RemoveGroup(((CListContainer<CContactListEntry*,CContactListGroup*>*)pContactEntry)->GetGroupData());
// Reenumerate all subcontacts (maybe MetaContacts was disabled
- int numContacts = CallService(MS_MC_GETNUMCONTACTS,hContact,0);
+ int numContacts = db_mc_getSubCount(hContact);
for(int i=0;i<numContacts;i++) {
- MCONTACT hSubContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT,hContact, (LPARAM)i);
+ MCONTACT hSubContact = db_mc_getSub(hContact, i);
if(!FindContact(hSubContact))
AddContact(hSubContact);
}
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index a7eb35ca46..5b7f0edd6a 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -2284,10 +2284,10 @@ void ImportKey()
{
if(for_all_sub)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str());
}
@@ -2338,10 +2338,10 @@ void ImportKey()
{
if(for_all_sub)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
{
char *tmp = NULL;
diff --git a/plugins/New_GPG/src/metacontacts.cpp b/plugins/New_GPG/src/metacontacts.cpp
index 9896393cbc..d730dae4b0 100644
--- a/plugins/New_GPG/src/metacontacts.cpp
+++ b/plugins/New_GPG/src/metacontacts.cpp
@@ -27,7 +27,7 @@ bool metaIsProtoMetaContacts(MCONTACT hContact)
bool metaIsDefaultSubContact(MCONTACT hContact)
{
- return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, db_mc_getMeta(hContact), 0) == hContact;
+ return db_mc_getDefault(db_mc_getMeta(hContact)) == hContact;
}
MCONTACT metaGetContact(MCONTACT hContact)
@@ -44,19 +44,9 @@ MCONTACT metaGetMostOnline(MCONTACT hContact)
return NULL;
}
-MCONTACT metaGetDefault(MCONTACT hContact)
+MCONTACT db_mc_getDefault(MCONTACT hContact)
{
if(metaIsProtoMetaContacts(hContact))
- return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,hContact,0);
+ return db_mc_getDefault(hContact);
return NULL;
}
-
-DWORD metaGetContactsNum(MCONTACT hContact)
-{
- return CallService(MS_MC_GETNUMCONTACTS, hContact, 0);
-}
-
-MCONTACT metaGetSubcontact(MCONTACT hContact, int num)
-{
- return (MCONTACT)CallService(MS_MC_GETSUBCONTACT, hContact, (LPARAM)num);
-}
diff --git a/plugins/New_GPG/src/metacontacts.h b/plugins/New_GPG/src/metacontacts.h
index d908d1e8a8..0819239f01 100644
--- a/plugins/New_GPG/src/metacontacts.h
+++ b/plugins/New_GPG/src/metacontacts.h
@@ -18,6 +18,4 @@ bool metaIsProtoMetaContacts(MCONTACT hContact);
bool metaIsDefaultSubContact(MCONTACT hContact) ;
MCONTACT metaGetContact(MCONTACT hContact);
MCONTACT metaGetMostOnline(MCONTACT hContact);
-MCONTACT metaGetDefault(MCONTACT hContact);
-DWORD metaGetContactsNum(MCONTACT hContact);
-MCONTACT metaGetSubcontact(MCONTACT hContact, int num);
+
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index cf05777171..dcedbd4b4e 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -263,10 +263,10 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if(MessageBox(0, TranslateT("Do you want to remove key from entire metacontact (all subcontacts)?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
MCONTACT hcnt = NULL;
- int count = metaGetContactsNum(meta);
+ int count = db_mc_getSubCount(meta);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(meta, i);
+ hcnt = db_mc_getSub(meta, i);
if(hcnt)
{
db_unset(hcnt, szGPGModuleName, "KeyID");
@@ -880,10 +880,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
if(MessageBox(0, TranslateT("Do you want to load key for all subcontacts?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
allsubcontacts = true;
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str());
}
@@ -944,10 +944,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_unset(hcnt, szGPGModuleName, "bAlwatsTrust");
}
@@ -975,10 +975,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyID", tmp2);
}
@@ -1024,10 +1024,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str());
}
@@ -1061,10 +1061,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str());
}
@@ -1087,10 +1087,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
}
@@ -1116,10 +1116,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
}
@@ -1187,10 +1187,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
{
if(!isContactSecured(hcnt))
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index c20a6645de..ae46d01671 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -211,10 +211,10 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
{
if(MessageBox(0, TranslateT("Do you want to toggle encryption for all subcontacts?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_b(hcnt, szGPGModuleName, "GPGEncryption", enc?0:1);
}
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index d824abb9b2..29138bf63f 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -943,7 +943,7 @@ BOOL IsUtfSendAvailable(MCONTACT hContact)
if (szProto == NULL) return FALSE;
//check for MetaContact and get szProto from subcontact
if (!strcmp(szProto, META_PROTO)) {
- MCONTACT hSubContact = (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, hContact, 0);
+ MCONTACT hSubContact = db_mc_getDefault(hContact);
if (!hSubContact)
return FALSE;
szProto = GetContactProto(hSubContact);
diff --git a/plugins/SecureIM/src/crypt_metacontacts.cpp b/plugins/SecureIM/src/crypt_metacontacts.cpp
index c104044f87..a874f5bb1c 100644
--- a/plugins/SecureIM/src/crypt_metacontacts.cpp
+++ b/plugins/SecureIM/src/crypt_metacontacts.cpp
@@ -10,7 +10,7 @@ BOOL isProtoMetaContacts(MCONTACT hContact)
BOOL isDefaultSubContact(MCONTACT hContact)
{
- return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, db_mc_getMeta(hContact), 0) == hContact;
+ return db_mc_getDefault(db_mc_getMeta(hContact)) == hContact;
}
MCONTACT getMostOnline(MCONTACT hContact)
@@ -23,8 +23,8 @@ void DeinitMetaContact(MCONTACT hContact)
{
MCONTACT hMetaContact = isProtoMetaContacts(hContact) ? hContact : db_mc_getMeta(hContact);
if (hMetaContact) {
- for (int i=0; i < CallService(MS_MC_GETNUMCONTACTS,(WPARAM)hMetaContact,0); i++) {
- MCONTACT hSubContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hMetaContact, i);
+ for (int i=0; i < db_mc_getSubCount(hMetaContact); i++) {
+ MCONTACT hSubContact = db_mc_getSub(hMetaContact, i);
if (hSubContact && (isContactSecured(hSubContact)&SECURED))
CallContactService(hSubContact,PSS_MESSAGE, PREF_METANODB, (LPARAM)SIG_DEIN);
}
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 1c66b5294b..8a630c4549 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -2345,8 +2345,8 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg)
AppendMenu(hMenu, MF_STRING | MF_DISABLED | MF_GRAYED | MF_CHECKED, 1, TranslateT("Meta Contact"));
AppendMenu(hMenu, MF_SEPARATOR, 1, _T(""));
- int iNumProtos = (int)CallService(MS_MC_GETNUMCONTACTS, dat->hContact, 0);
- int iDefaultProtoByNum = (int)CallService(MS_MC_GETDEFAULTCONTACTNUM, dat->hContact, 0);
+ int iNumProtos = db_mc_getSubCount(dat->hContact);
+ int iDefaultProtoByNum = db_mc_getSubCount(dat->hContact);
MCONTACT hContactMostOnline = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, dat->hContact, 0);
char *szProtoMostOnline = GetContactProto(hContactMostOnline);
int isForced = M.GetDword(dat->hContact, "tabSRMM_forced", -1);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 064a069700..763620c02c 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -3097,7 +3097,7 @@ quote_from_last:
}
}
else if (iSelection >= 1000) // the "default" menu...
- CallService(MS_MC_SETDEFAULTCONTACTNUM, dat->hContact, (LPARAM)(iSelection - 1000));
+ db_mc_setDefaultNum(dat->hContact, iSelection - 1000);
DestroyMenu(hMC);
InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index fe6cfe6e30..ad64b02afe 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -413,13 +413,13 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
char *szProto = GetContactProto(hContact);
if (szProto && !strcmp(szProto, META_PROTO)) {
- iNumber = CallService(MS_MC_GETNUMCONTACTS, hContact, 0);
- hTmpContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, hContact, 0);
+ iNumber = db_mc_getSubCount(hContact);
+ hTmpContact = db_mc_getSub(hContact, 0);
}
for (int i = 0; i < iNumber; i++) {
if (i > 0)
- hTmpContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, hContact, i);
+ hTmpContact = db_mc_getSub(hContact, i);
dwRecountTs = db_get_dw(hTmpContact, MODULE, "LastCountTS", 0);
dwTime = (DWORD)time(0);
dwDiff = (dwTime - dwRecountTs);
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp
index 59e861d446..3078c2f4bd 100644
--- a/plugins/UserInfoEx/src/classMAnnivDate.cpp
+++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp
@@ -482,9 +482,9 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto)
// try to get birthday date from metacontact's subcontact
else if (DB::Module::IsMetaAndScan(pszProto)) {
// try to get setting from the default subcontact first
- const int def = DB::MetaContact::SubDefNum(hContact);
+ const int def = db_mc_getDefaultNum(hContact);
if (def > -1 && def < INT_MAX) {
- MCONTACT hSubContact = DB::MetaContact::Sub(hContact, def);
+ MCONTACT hSubContact = db_mc_getSub(hContact, def);
if (hSubContact != NULL && !DBGetBirthDate(hSubContact, NULL)) {
RemoveFlags(MADF_HASCUSTOM);
SetFlags(MADF_HASMETA);
@@ -493,12 +493,12 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto)
// scan all subcontacts for the setting
if (_wFlags == 0) {
- const int cnt = DB::MetaContact::SubCount(hContact);
+ const int cnt = db_mc_getSubCount(hContact);
if (cnt < INT_MAX) {
for (int i = 0; i < cnt; i++) {
if (i != def) {
- MCONTACT hSubContact = DB::MetaContact::Sub(hContact, i);
+ MCONTACT hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL && !DBGetBirthDate(hSubContact, NULL)) {
RemoveFlags(MADF_HASCUSTOM);
SetFlags(MADF_HASMETA);
@@ -735,7 +735,7 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo
MAnnivDate mdbNewProto;
MAnnivDate mdbIgnore;
- const int nSubContactCount = (bIsMeta) ? DB::MetaContact::SubCount(hContact) : 0;
+ const int nSubContactCount = (bIsMeta) ? db_mc_getSubCount(hContact) : 0;
BYTE bWantBackup = !mdbNewProto.DBGetDate(hContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)
&& !IsEqual(mdbNewProto.SystemTime())
@@ -744,7 +744,7 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo
// allow backup only, if the custom setting differs from all meta subcontacts' protocol based settings, too.
for (int i = 0; (i < nSubContactCount) && bWantBackup && bIsMeta; i++) {
- MCONTACT hSubContact = DB::MetaContact::Sub(hContact, i);
+ MCONTACT hSubContact = db_mc_getSub(hContact, i);
if (hSubContact && !mdbIgnore.DBGetDate(hSubContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
bWantBackup = bWantBackup
&& !IsEqual(mdbIgnore.SystemTime())
@@ -769,7 +769,7 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo
// update metasubcontacts
for (int i = 0; i < nSubContactCount; i++) {
- MCONTACT hSubContact = DB::MetaContact::Sub(hContact, i);
+ MCONTACT hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL) {
if (!mdbIgnore.DBGetDate(hSubContact, DB::Contact::Proto(hSubContact), SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
mdbIgnore.DBWriteDateStamp(hSubContact, USERINFO, SET_REMIND_BIRTHDAY_IGNORED);
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp
index d9188ee74e..9f303cb8a1 100644
--- a/plugins/UserInfoEx/src/dlg_propsheet.cpp
+++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp
@@ -310,12 +310,12 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam)
// metacontacts sub pages
if (bScanMetaSubContacts) {
- int numSubs = DB::MetaContact::SubCount(wParam);
+ int numSubs = db_mc_getSubCount(wParam);
psh._dwFlags &= ~PSF_PROTOPAGESONLY_INIT;
psh._dwFlags |= PSF_PROTOPAGESONLY;
for (int i = 0; i < numSubs; i++) {
- psh._hContact = DB::MetaContact::Sub(wParam, i);
+ psh._hContact = db_mc_getSub(wParam, i);
psh._nSubContact = i;
if (psh._hContact) {
psh._pszProto = DB::Contact::Proto(psh._hContact);
@@ -1574,9 +1574,9 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
// need meta contact's subcontact information
if (DB::Module::IsMetaAndScan(pPs->pszProto)) {
// count valid subcontacts whose protocol supports the PSS_GETINFO service to update the information
- int numSubs = DB::MetaContact::SubCount(pPs->hContact);
+ int numSubs = db_mc_getSubCount(pPs->hContact);
for (int i = 0; i < numSubs; i++) {
- MCONTACT hSubContact = DB::MetaContact::Sub(pPs->hContact, i);
+ MCONTACT hSubContact = db_mc_getSub(pPs->hContact, i);
if (hSubContact != NULL) {
if (ProtoServiceExists(DB::Contact::Proto(hSubContact), PSS_GETINFO)) {
pPs->infosUpdated = (TAckInfo*)mir_realloc(pPs->infosUpdated, sizeof(TAckInfo)* (pPs->nSubContacts + 1));
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
index d253876279..b2c2bf80d4 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
@@ -217,9 +217,9 @@ int CExImContactXML::Export(FILE *xmlfile, DB::CEnumList* pModules)
if (isMeta()) {
CExImContactXML vContact(_pXmlFile);
- const int cnt = DB::MetaContact::SubCount(_hContact);
- const int def = DB::MetaContact::SubDefNum(_hContact);
- MCONTACT hSubContact = DB::MetaContact::Sub(_hContact, def);
+ const int cnt = db_mc_getSubCount(_hContact);
+ const int def = db_mc_getDefaultNum(_hContact);
+ MCONTACT hSubContact = db_mc_getSub(_hContact, def);
// export default subcontact
if (hSubContact && vContact.fromDB(hSubContact))
@@ -227,7 +227,7 @@ int CExImContactXML::Export(FILE *xmlfile, DB::CEnumList* pModules)
for (int i = 0; i < cnt; i++) {
if (i != def) {
- hSubContact = DB::MetaContact::Sub(_hContact, i);
+ hSubContact = db_mc_getSub(_hContact, i);
if (hSubContact && vContact.fromDB(hSubContact))
vContact.ExportSubContact(this, pModules);
}
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp
index 17f77c8161..4a06374b8d 100644
--- a/plugins/UserInfoEx/src/mir_db.cpp
+++ b/plugins/UserInfoEx/src/mir_db.cpp
@@ -23,36 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace DB {
-namespace MetaContact {
-
-INT_PTR SubCount(MCONTACT hMetaContact)
-{
- INT_PTR result = CallService(MS_MC_GETNUMCONTACTS, (WPARAM) hMetaContact, 0);
- return (result == CALLSERVICE_NOTFOUND) ? -1 : result;
-}
-
-INT_PTR SubDefNum(MCONTACT hMetaContact)
-{
- INT_PTR result = CallService(MS_MC_GETDEFAULTCONTACTNUM, (WPARAM) hMetaContact, 0);
- return (result == CALLSERVICE_NOTFOUND) ? -1 : result;
-}
-
-MCONTACT Sub(MCONTACT hMetaContact, int idx)
-{
- if (idx != -1) {
- INT_PTR result = CallService(MS_MC_GETSUBCONTACT, (WPARAM) hMetaContact, (LPARAM) idx);
- return (result == CALLSERVICE_NOTFOUND) ? NULL : (MCONTACT)result;
- }
- return NULL;
-}
-
-MCONTACT GetMeta(MCONTACT hContact)
-{
- return db_mc_getMeta(hContact);
-}
-
-} /* namespace MetaContact */
-
/**
* This namespace contains all functions used to access or modify contacts in the database.
**/
@@ -297,22 +267,22 @@ BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetti
result = Get(hContact, pszProto, pszSetting, dbv, destType) != 0;
// try to get setting from a metasubcontact
if (result && DB::Module::IsMetaAndScan(pszProto)) {
- const INT_PTR def = DB::MetaContact::SubDefNum(hContact);
+ const INT_PTR def = db_mc_getDefaultNum(hContact);
MCONTACT hSubContact;
// try to get setting from the default subcontact first
if (def > -1 && def < INT_MAX) {
- hSubContact = DB::MetaContact::Sub(hContact, def);
+ hSubContact = db_mc_getSub(hContact, def);
if (hSubContact != NULL)
result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0;
}
// scan all subcontacts for the setting
if (result) {
- const INT_PTR cnt = DB::MetaContact::SubCount(hContact);
+ const INT_PTR cnt = db_mc_getSubCount(hContact);
if (cnt < INT_MAX) {
INT_PTR i;
for (i = 0; result && i < cnt; i++) {
if (i != def) {
- hSubContact = DB::MetaContact::Sub(hContact, i);
+ hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL)
result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0;
} } } } } }
@@ -352,11 +322,11 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps
// try to read the setting from the sub contacts' modules
else if (DB::Module::IsMetaAndScan(pszProto)) {
- const INT_PTR def = DB::MetaContact::SubDefNum(hContact);
+ const INT_PTR def = db_mc_getDefaultNum(hContact);
MCONTACT hSubContact;
// try to get setting from the default subcontact first
if (def > -1 && def < INT_MAX) {
- hSubContact = DB::MetaContact::Sub(hContact, def);
+ hSubContact = db_mc_getSub(hContact, def);
if (hSubContact != NULL) {
wFlags = GetCtrl(hSubContact, pszSubModule, NULL, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType);
if (wFlags != 0) {
@@ -368,10 +338,10 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps
// copy the missing settings from the other subcontacts
if (wFlags == 0) {
INT_PTR i;
- const INT_PTR cnt = DB::MetaContact::SubCount(hContact);
+ const INT_PTR cnt = db_mc_getSubCount(hContact);
for (i = 0; i < cnt; i++) {
if (i != def) {
- hSubContact = DB::MetaContact::Sub(hContact, i);
+ hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL) {
wFlags = GetCtrl(hSubContact, pszSubModule, NULL, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType);
if (wFlags != 0) {
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h
index ae6ec11c25..93df0f2a36 100644
--- a/plugins/UserInfoEx/src/mir_db.h
+++ b/plugins/UserInfoEx/src/mir_db.h
@@ -23,14 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace DB {
-namespace MetaContact{
- INT_PTR SubCount(MCONTACT hMetaContact);
- INT_PTR SubDefNum(MCONTACT hMetaContact);
- MCONTACT Sub(MCONTACT hMetaContact, int idx);
-
- MCONTACT GetMeta(MCONTACT hContact);
-} /* namespace MetaContact */
-
/**
* This namespace contains all functions used to access
* or modify contacts in the database.
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp
index c63bc0e4ab..11a1b73eaf 100644
--- a/plugins/UserInfoEx/src/psp_profile.cpp
+++ b/plugins/UserInfoEx/src/psp_profile.cpp
@@ -1143,22 +1143,19 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
// scan all basic protocols for the subcontacts
if (DB::Module::IsMetaAndScan(pszProto)) {
- int iDefault = CallService(MS_MC_GETDEFAULTCONTACTNUM, hContact, NULL);
+ int iDefault = db_mc_getDefaultNum(hContact);
MCONTACT hSubContact, hDefContact;
LPCSTR pszSubBaseProto;
- int j, numSubs;
- if ((hDefContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, hContact, iDefault)) &&
- (pszSubBaseProto = DB::Contact::Proto(hDefContact)))
- {
+ if ((hDefContact = db_mc_getSub(hContact, iDefault)) && (pszSubBaseProto = DB::Contact::Proto(hDefContact))) {
if ((numProtoItems += ProfileList_AddItemlistFromDB(pList, iItem, idList, nList, hDefContact, pszSubBaseProto, pFmt[i].szCatFmt, pFmt[i].szValFmt, CTRLF_HASMETA|CTRLF_HASPROTO)) < 0)
return FALSE;
// copy the missing settings from the other subcontacts
- numSubs = CallService(MS_MC_GETNUMCONTACTS, hContact, NULL);
- for (j = 0; j < numSubs; j++) {
+ int numSubs = db_mc_getSubCount(hContact);
+ for (int j = 0; j < numSubs; j++) {
if (j == iDefault) continue;
- if (!(hSubContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, hContact, j))) continue;
+ if (!(hSubContact = db_mc_getSub(hContact, j))) continue;
if (!(pszSubBaseProto = DB::Contact::Proto(hSubContact))) continue;
if ((numProtoItems += ProfileList_AddItemlistFromDB(pList, iItem, idList, nList, hSubContact, pszSubBaseProto, pFmt[i].szCatFmt, pFmt[i].szValFmt, CTRLF_HASMETA|CTRLF_HASPROTO)) < 0)
return FALSE;
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index c22b9089c1..e2af3f6161 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -654,7 +654,7 @@ static int OnContactSettingChanged(MCONTACT hContact, DBCONTACTWRITESETTING* pdb
!strncmp(pdbcws->szSetting, "Anniv", 5) ||
!strncmp(pdbcws->szSetting, "DOB", 3)))
{
- MCONTACT hMeta = DB::MetaContact::GetMeta(hContact);
+ MCONTACT hMeta = db_mc_getMeta(hContact);
WORD LastAnswer = IDNONE;
CEvent evt;
MTime now;
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp
index e027eb0f2d..95503525d5 100644
--- a/plugins/Variables/src/parse_metacontacts.cpp
+++ b/plugins/Variables/src/parse_metacontacts.cpp
@@ -82,7 +82,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai)
return NULL;
}
- hContact = (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, hContact, 0);
+ hContact = db_mc_getDefault(hContact);
if (hContact == NULL)
return NULL;