diff options
332 files changed, 1332 insertions, 1765 deletions
diff --git a/bin10/lib/mir_app.lib b/bin10/lib/mir_app.lib Binary files differindex 14bb292e64..cdb37a634b 100644 --- a/bin10/lib/mir_app.lib +++ b/bin10/lib/mir_app.lib diff --git a/bin10/lib/mir_app64.lib b/bin10/lib/mir_app64.lib Binary files differindex ec941dda4b..27a8590b68 100644 --- a/bin10/lib/mir_app64.lib +++ b/bin10/lib/mir_app64.lib diff --git a/bin12/lib/mir_app.lib b/bin12/lib/mir_app.lib Binary files differindex 14bb292e64..cdb37a634b 100644 --- a/bin12/lib/mir_app.lib +++ b/bin12/lib/mir_app.lib diff --git a/bin12/lib/mir_app64.lib b/bin12/lib/mir_app64.lib Binary files differindex ec941dda4b..27a8590b68 100644 --- a/bin12/lib/mir_app64.lib +++ b/bin12/lib/mir_app64.lib diff --git a/include/delphi/m_protocols.inc b/include/delphi/m_protocols.inc index 8e3bd4d455..a7d5d545e7 100644 --- a/include/delphi/m_protocols.inc +++ b/include/delphi/m_protocols.inc @@ -168,6 +168,7 @@ type type
PPROTOCOLDESCRIPTOR = ^TPROTOCOLDESCRIPTOR;
+ PPPROTOCOLDESCRIPTOR = ^PPROTOCOLDESCRIPTOR;
TPROTOCOLDESCRIPTOR = record
cbSize : size_t;
szName : PAnsiChar; // unique name of the module
@@ -202,24 +203,26 @@ const Returns a pointer to the PROTOCOLDESCRIPTOR if the protocol is loaded, or
NULL if it isn't.
}
- MS_PROTO_ISPROTOCOLLOADED:PAnsiChar = 'Proto/IsProtocolLoaded';
+
+function Proto_IsProtocolLoaded(protoName:PAnsiCHar) : PPROTOCOLDESCRIPTOR; stdcall;
+ external AppDLL name 'Proto_IsProtocolLoaded';
{ gets the network-level protocol associated with a contact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
Returns a AnsiChar* pointing to the asciiz name of the protocol or NULL if the
contact has no protocol. There is no need to free() it or anything.
This is the name of the module that actually accesses the network for that
contact. }
- MS_PROTO_GETCONTACTBASEPROTO = 'Proto/GetContactBaseProto';
+
+function Proto_GetProtoName(hContact:TMCONTACT) : PAnsiChar; stdcall;
+ external AppDLL name 'GetContactProto';
{ determines whether the specified contact has the given protocol in its chain
wParam=(WPARAM)(HANDLE)hContact
lParam=(LPARAM)(const AnsiChar*)szName
Returns -1 if it is base protocol, positive number if it is filter and 0 if it doesn't }
+const
MS_PROTO_ISPROTOONCONTACT:PAnsiChar = 'Proto/IsProtoOnContact';
-const
PROTOTYPE_SELFTYPING_OFF = 0;
PROTOTYPE_SELFTYPING_ON = 1;
{ This service is for notifying protocols that the user is typing a message v0.3.3+
@@ -256,6 +259,7 @@ const type
PPROTOACCOUNT = ^TPROTOACCOUNT;
+ PPPROTOACCOUNT = ^PPROTOACCOUNT;
TPROTOACCOUNT = record
cbSize :int; // sizeof this structure
szModuleName :PAnsiChar; // unique physical account name (matches database module name)
@@ -273,13 +277,12 @@ type end;
tagACCOUNT = TPROTOACCOUNT;
-const
//account enumeration service
-//wParam=(WPARAM)(int)piNumAccounts
-//lParam=(LPARAM)(PROTOACCOUNT**)paAccounts
- MS_PROTO_ENUMACCOUNTS:PAnsiChar = 'Proto/EnumAccounts';
+procedure Proto_EnumAccounts(var nAccs:int; var pAccs:PPPROTOACCOUNT); stdcall;
+ external AppDLL name 'Proto_EnumAccounts';
- MS_PROTO_ENUMPROTOS :PAnsiChar = 'Proto/EnumProtos'; // MIRANDA_VER >= $800
+procedure Proto_EnumProtocols(var nProtos:int; var pProtos:PPPROTOCOLDESCRIPTOR); stdcall;
+ external AppDLL name 'Proto_EnumProtocols';
type
PACC_CREATE = ^TACC_CREATE;
@@ -300,7 +303,10 @@ const //wParam=0
//lParam=(LPARAM)(AnsiChar*)szAccountName
//return value = PROTOACCOUNT* or NULL
- MS_PROTO_GETACCOUNT:PAnsiChar = 'Proto/GetAccount';
+
+function Proto_GetAccount(proto:PAnsiChar) : PPROTOACCOUNT; stdcall;
+ external AppDLL name 'Proto_GetAccount';
+
(*
__inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName )
{ return (PROTOACCOUNT* )CallService( MS_PROTO_GETACCOUNT, 0, (LPARAM)accName );
@@ -311,6 +317,7 @@ __inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName ) //wParam = event type (1 - added, 2 - changed, 3 - deleted, 5 - enabled/disabled)
//lParam = (LPARAM)(PROTOACCOUNT*) - account being changed
+const
PRAC_ADDED = 1;
PRAC_CHANGED = 2;
PRAC_REMOVED = 3;
@@ -329,11 +336,11 @@ __inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName ) {
determines if an account is enabled or not
- wParam = 0
- lParam = PPROTOACCOUNT
Returns 1 if an account is valid and enabled, 0 otherwise
}
- MS_PROTO_ISACCOUNTENABLED:PAnsiChar = 'Proto/IsAccountEnabled';
+
+function Proto_IsAccountEnabled(proto:PPROTOACCOUNT) : byte; stdcall;
+ external AppDLL name 'Proto_IsAccountEnabled';
{
determines if an account is locked or not
@@ -341,17 +348,19 @@ __inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName ) lParam = PAnsiChar szAccountName
Returns 1 if an account is locked and not supposed to change status, 0 otherwise
}
- MS_PROTO_ISACCOUNTLOCKED:PAnsiChar = 'Proto/IsAccountLocked';
+
+function Proto_IsAccountLocked(proto:PAnsiChar) : byte; stdcall;
+ external AppDLL name 'Proto_IsAccountLocked';
{
gets the account associated with a contact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
Returns a PAnsiChar pointing to the asciiz name of the protocol or NULL if the
contact has no protocol. There is no need to mir_free() it or anything.
This is the name of the module that actually accesses the network for that contact.
}
- MS_PROTO_GETCONTACTBASEACCOUNT:PAnsiChar = 'Proto/GetContactBaseAccount';
+
+function Proto_GetBaseAccountName(hContact:TMCONTACT) : PAnsiChar; stdcall;
+ external AppDLL name 'Proto_GetBaseAccountName';
// -------------- avatar support ---------------------
{
@@ -384,6 +393,7 @@ __inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName ) When ACKRESULT_STATUS, hProcess is the result code - the value of this is protocol dependent,
See protocol documentation to do with avatars for what codes are defined and what they mean.
}
+
const
PA_FORMAT_UNKNOWN = 0; // the protocol can not determine much about the "bitmap"
PA_FORMAT_PNG = 1; // the image is PNG
diff --git a/include/delphi/m_protomod.inc b/include/delphi/m_protomod.inc index aab9706e37..416d5758e5 100644 --- a/include/delphi/m_protomod.inc +++ b/include/delphi/m_protomod.inc @@ -27,78 +27,64 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. {$INCLUDE m_protocols.inc}
{$ENDIF}
-const
- {
- wParam : 0
- lParam : Pointer to a initalised TPROTOCOLDESCRIPTOR structure
- Affect : Register a protocol module, see notes
- Returns: 0 on success, [non zero] on failure
- Notes : This service MUST be called from your module's Load() function
- TPROTOCOLDESCRIPTOR.type can be a value other than PROTOTYPE_*
- which are used to provide a more precise positioning information
- for the contact protocol lists.
- -
- Relative values to the constants can be given, but this MUST NOT
- be done for PROTOTYPE_PROTOCOL.
- }
- MS_PROTO_REGISTERMODULE:PAnsiChar = 'Proto/RegisterModule';
-
- {
- wParam : TMCONTACT
- lParam : protocol_name_string
- Affect : Add the given protocol module to the chain for a contact, see notes
- Returns: 0 success, [non zero] on failure
- Notes : The module is added to the correct positioning according to it's
- registered type.
- }
- MS_PROTO_ADDTOCONTACT:PAnsiChar = 'Proto/AddToContact';
-
- {
- wParam : TMCONTACT
- lParam : protocol_name_string
- Affect : Remove the given protocol name from the chain for the given contact
- Returns: 0 on success, [non zero] on failure
- }
- MS_PROTO_REMOVEFROMCONTACT:PAnsiChar = 'Proto/RemoveFromContact';
-
- { see m_globaldefs.pas for CreateProtoServiceFunction }
-
- {
- wParam : wParam [arg]
- lParam : lParam [arg]
- Affect : Call the next service in the chain for the send operation, see notes
- Return : Return value should be returned by CallService(MS_PROTO_CHAINSEND,wParam,lParam)
- Notes : wParam MUST remain untouched, lParam is a pointer to a CSSDATA structure
- and can be modified or copid if needed.
- wParam and lParam should be the values passed to your service,
- typically your service should return ASAP.
- }
- MS_PROTO_CHAINSEND:PAnsiChar = 'Proto/ChainSend';
-
- {
- wParam : wParam [arg]
- lParam : lParam [arg]
- Affect : Call the next service in the chain in this receive operation, see notes
- Return : Return value should be returned by CallService(MS_PROTO_CHAINRECV,wParam,lParam)
- Notes : wParam MUST remain untouched, lParam is a pointer to a CSSDATA structure
- and can be modified or copied if needed.
- wParam and lParam should be the values passed to your service,
- typically your service should return ASAP.
- -
- MS_PROTO_CHAINRECV is thread safe since 0.1.2.0 -- calls
- are translated to the main thread and passed from there.
- }
- MS_PROTO_CHAINRECV:PAnsiChar = 'Proto/ChainRecv';
-
- {
- wParam : 0
- lParam : Pointer to an initalised ACKDATA
- Affect : Broadcast a ME_PROTO_ACK event, see notes
- Returns: The return value of the NotifyEventHooks() call
- Notes : ME_PROTO_ACK is completely thread safe since 01.2.0
- see notes in core/modules.h under NotifyEventHooks()
- }
- MS_PROTO_BROADCASTACK:PAnsiChar = 'Proto/BroadcastAck';
+{
+ Affect : Register a protocol module, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : This service MUST be called from your module's Load() function
+ TPROTOCOLDESCRIPTOR.type can be a value other than PROTOTYPE_*
+ which are used to provide a more precise positioning information
+ for the contact protocol lists.
+ -
+ Relative values to the constants can be given, but this MUST NOT
+ be done for PROTOTYPE_PROTOCOL.
+}
+
+function Proto_RegisterModule(descr:pPROTOCOLDESCRIPTOR) : int; stdcall;
+ external AppDLL name 'Proto_RegisterModule';
+
+{
+ Affect : Add the given protocol module to the chain for a contact, see notes
+ Returns: 0 success, [non zero] on failure
+ Notes : The module is added to the correct positioning according to it's
+ registered type.
+}
+
+function Proto_AddToContact(hContact:TMCONTACT; proto:PAnsiChar) : int; stdcall;
+ external AppDLL name 'Proto_AddToContact';
+
+{
+ Affect : Remove the given protocol name from the chain for the given contact
+ Returns: 0 on success, [non zero] on failure
+}
+
+function Proto_RemoveFromContact(hContact:TMCONTACT; proto:PAnsiChar) : int; stdcall;
+ external AppDLL name 'Proto_RemoveFromContact';
+
+{
+ Affect : Call the next service in the chain for the send operation, see notes
+ Return : Return value should be returned by CallService(MS_PROTO_CHAINSEND,wParam,lParam)
+ Notes : wParam MUST remain untouched, lParam is a pointer to a CSSDATA structure
+ and can be modified or copid if needed.
+ wParam and lParam should be the values passed to your service,
+ typically your service should return ASAP.
+}
+
+function Proto_ChainSend(order:int; ccs:pCCSDATA) : INT_PTR; stdcall;
+ external AppDLL name 'Proto_ChainSend';
+
+{
+ Affect : Call the next service in the chain in this receive operation, see notes
+ Return : Return value should be returned by CallService(MS_PROTO_CHAINRECV,wParam,lParam)
+ Notes : wParam MUST remain untouched, lParam is a pointer to a CSSDATA structure
+ and can be modified or copied if needed.
+ wParam and lParam should be the values passed to your service,
+ typically your service should return ASAP.
+ -
+ MS_PROTO_CHAINRECV is thread safe since 0.1.2.0 -- calls
+ are translated to the main thread and passed from there.
+}
+function Proto_ChainRecv(order:int; ccs:pCCSDATA) : INT_PTR; stdcall;
+ external AppDLL name 'Proto_ChainRecv';
{$ENDIF}
diff --git a/include/m_icq.h b/include/m_icq.h index 0f9c17add7..867d9537e4 100644 --- a/include/m_icq.h +++ b/include/m_icq.h @@ -32,7 +32,7 @@ #ifndef M_ICQ_H__
#define M_ICQ_H__ 1
-
+#include <m_protosvc.h>
//extended search result structure, used for all searches
typedef struct {
diff --git a/include/m_protocols.h b/include/m_protocols.h index 0a024340e8..4003efcb85 100644 --- a/include/m_protocols.h +++ b/include/m_protocols.h @@ -32,11 +32,6 @@ struct PROTO_INTERFACE; #include "statusmodes.h"
#include <m_core.h>
-// send a general request through the protocol chain for a contact
-// wParam = 0
-// lParam = (LPARAM)(CCSDATA*)&ccs
-// returns the value as documented in the PS_ definition (m_protosvc.h)
-
typedef struct {
MCONTACT hContact;
const char *szProtoService; // a PS_ constant
@@ -44,23 +39,14 @@ typedef struct { LPARAM lParam;
} CCSDATA;
-#define MS_PROTO_CALLCONTACTSERVICE "Proto/CallContactService"
-
+/////////////////////////////////////////////////////////////////////////////////////////
// a general network 'ack'
// wParam = 0
// lParam = (LPARAM)(ACKDATA*)&ack
// Note that just because definitions are here doesn't mean they will be sent.
// Read the documentation for the function you are calling to see what replies
// you will receive.
-typedef struct {
- int cbSize;
- const char *szModule; // the name of the protocol module which initiated this ack
- MCONTACT hContact;
- int type; // an ACKTYPE_ constant
- int result; // an ACKRESULT_ constant
- HANDLE hProcess; // a caller-defined process code
- LPARAM lParam; // caller-defined extra info
-} ACKDATA;
+
#define ACKTYPE_MESSAGE 0
#define ACKTYPE_URL 1
#define ACKTYPE_FILE 2
@@ -95,9 +81,19 @@ typedef struct { #define ACKRESULT_CONNECTPROXY 110 // connecting to file proxy
#define ACKRESULT_SEARCHRESULT 111 // result of extended search
-#define ME_PROTO_ACK "Proto/Ack"
+typedef struct {
+ int cbSize;
+ const char *szModule; // the name of the protocol module which initiated this ack
+ MCONTACT hContact;
+ int type; // an ACKTYPE_ constant
+ int result; // an ACKRESULT_ constant
+ HANDLE hProcess; // a caller-defined process code
+ LPARAM lParam; // caller-defined extra info
+} ACKDATA;
+
+#define ME_PROTO_ACK "Proto/Ack"
-// v0.3.2+: When result is ACKRESULT_FAILED or ACKRESULT_DENIED, lParam can point to
+// When result is ACKRESULT_FAILED or ACKRESULT_DENIED, lParam can point to
// a human readable string with an explanation. For example: "The message was too
// long to be delivered". If no error message is specified, lParam must be NULL.
// Right now only explanations from ACKTYPE_MESSAGE is shown.
@@ -149,31 +145,27 @@ typedef struct tagPROTOFILETRANSFERSTATUS unsigned __int64 currentFileProgress;
unsigned __int64 currentFileTime; // as seconds since 1970
}
-PROTOFILETRANSFERSTATUS;
-
-// Enumerate the currently running protocols
-// wParam = (WPARAM)(int*)&numberOfProtocols
-// lParam = (LPARAM)(PROTOCOLDESCRIPTOR***)&ppProtocolDescriptors
-// Returns 0 on success, nonzero on failure
-// Neither wParam nor lParam may be NULL
-// The list returned by this service is the protocol modules currently installed
-// and running. It is not the complete list of all protocols that have ever been
-// installed.
-// IMPORTANT NOTE #1: the list returned is not static, it may be changed in the
-// program's lifetime. Do not use this list in the global context, copy protocols
-// names otherwise.
-// IMPORTANT NOTE #2: in version 0.8 this service is mapped to the MS_PROTO_ENUMACCOUNTS
-// service to provide the compatibility with old plugins (first three members of
-// PROTOACCOUNT are equal to the old PROTOCOLDESCRIPTOR format). If you declare the
-// MIRANDA_VER macro with value greater or equal to 0x800, use MS_PROTO_ENUMPROTOS
-// service instead to obtain the list of running protocols instead of accounts.
-// Note that a protocol module need not be an interface to an Internet server,
-// they can be encryption and loads of other things, too.
-// And yes, before you ask, that is triple indirection. Deal with it.
-// Access members using ppProtocolDescriptors[index]->element
+ PROTOFILETRANSFERSTATUS;
#define PROTOCOLDESCRIPTOR_V3_SIZE (sizeof(size_t)+sizeof(INT_PTR)+sizeof(char*))
+/////////////////////////////////////////////////////////////////////////////////////////
+// For recv, it will go from lower to higher, so in this case:
+// check ignore, decrypt (encryption), translate
+//
+// For send, it will go translate, encrypt, ignore(??), send
+//
+// The DB will store higher numbers here, LOWER in the protocol chain, and lower numbers
+// here HIGHER in the protocol chain
+
+#define PROTOTYPE_IGNORE 50 // added during v0.3.3
+#define PROTOTYPE_PROTOCOL 1000
+#define PROTOTYPE_VIRTUAL 1001 // virtual protocol (has no accounts)
+#define PROTOTYPE_ENCRYPTION 2000
+#define PROTOTYPE_FILTER 3000
+#define PROTOTYPE_TRANSLATION 4000
+#define PROTOTYPE_OTHER 10000 // avoid using this if at all possible
+
// initializes an empty account
typedef struct PROTO_INTERFACE* (*pfnInitProto)(const char* szModuleName, const TCHAR* szUserName);
@@ -195,69 +187,64 @@ typedef struct { }
PROTOCOLDESCRIPTOR;
-// v0.3.3+:
-//
-// For recv, it will go from lower to higher, so in this case:
-// check ignore, decrypt (encryption), translate
-//
-// For send, it will go translate, encrypt, ignore(??), send
-//
-// The DB will store higher numbers here, LOWER in the protocol chain, and lower numbers
-// here HIGHER in the protocol chain
-
-#define PROTOTYPE_IGNORE 50 // added during v0.3.3
-#define PROTOTYPE_PROTOCOL 1000
-#define PROTOTYPE_VIRTUAL 1001 // virtual protocol (has no accounts)
-#define PROTOTYPE_ENCRYPTION 2000
-#define PROTOTYPE_FILTER 3000
-#define PROTOTYPE_TRANSLATION 4000
-#define PROTOTYPE_OTHER 10000 // avoid using this if at all possible
+/////////////////////////////////////////////////////////////////////////////////////////
+// Enumerate the currently running protocols
+// Returns 0 on success, nonzero on failure
+// Neither wParam nor lParam may be NULL
+// The list returned by this service is the protocol modules currently installed
+// and running. It is not the complete list of all protocols that have ever been
+// installed.
+// IMPORTANT NOTE #1: the list returned is not static, it may be changed in the
+// program's lifetime. Do not use this list in the global context, copy protocols
+// names otherwise.
+// IMPORTANT NOTE #2: in version 0.8 this service is mapped to the MS_PROTO_ENUMACCOUNTS
+// service to provide the compatibility with old plugins (first three members of
+// PROTOACCOUNT are equal to the old PROTOCOLDESCRIPTOR format). If you declare the
+// MIRANDA_VER macro with value greater or equal to 0x800, use MS_PROTO_ENUMPROTOS
+// service instead to obtain the list of running protocols instead of accounts.
+// Note that a protocol module need not be an interface to an Internet server,
+// they can be encryption and loads of other things, too.
+// And yes, before you ask, that is triple indirection. Deal with it.
+// Access members using ppProtocolDescriptors[index]->element
-#define MS_PROTO_ENUMPROTOS "Proto/EnumProtos"
+EXTERN_C MIR_APP_DLL(void) Proto_EnumProtocols(int *nProtos, PROTOCOLDESCRIPTOR ***pProtos);
+/////////////////////////////////////////////////////////////////////////////////////////
// determines if a protocol module is loaded or not
-// wParam = 0 (unused)
-// lParam = (LPARAM)(const char*)szName
// Returns a pointer to the PROTOCOLDESCRIPTOR if the protocol is loaded, or
// NULL if it isn't.
-#define MS_PROTO_ISPROTOCOLLOADED "Proto/IsProtocolLoaded"
-#ifdef __cplusplus
-extern "C"
-#endif
-MIR_APP_DLL(PROTOCOLDESCRIPTOR*) Proto_IsProtocolLoaded(const char *szProtoName);
+EXTERN_C MIR_APP_DLL(PROTOCOLDESCRIPTOR*) Proto_IsProtocolLoaded(const char *szProtoName);
+/////////////////////////////////////////////////////////////////////////////////////////
// gets the network-level protocol associated with a contact
-// wParam = (MCONTACT)hContact
-// lParam = 0
// Returns a char* pointing to the asciiz name of the protocol or NULL if the
// contact has no protocol. There is no need to free() it or anything.
// This is the name of the module that actually accesses the network for that
// contact.
-#define MS_PROTO_GETCONTACTBASEPROTO "Proto/GetContactBaseProto"
-__forceinline char* GetContactProto(MCONTACT hContact)
-{ return (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0);
-}
+EXTERN_C MIR_APP_DLL(char*) GetContactProto(MCONTACT hContact);
+/////////////////////////////////////////////////////////////////////////////////////////
// determines whether the specified contact has the given protocol in its chain
-// wParam = (MCONTACT)hContact
-// lParam = (LPARAM)(const char*)szName
// Returns -1 if it is base protocol, positive number if it is filter and 0 if it doesn't
-#define MS_PROTO_ISPROTOONCONTACT "Proto/IsProtoOnContact"
-#define PROTOTYPE_SELFTYPING_OFF 0
-#define PROTOTYPE_SELFTYPING_ON 1
+EXTERN_C MIR_APP_DLL(int) Proto_IsProtoOnContact(MCONTACT hContact, const char *szProto);
+
+/////////////////////////////////////////////////////////////////////////////////////////
// This service is for notifying protocols that the user is typing a message v0.3.3+
// in a message dialog.
// This is typically sent by a message dialog when a user in the clist is typing.
// wParam = (MCONTACT)hContact
// lParam = (LPARAM)(int)typing state
// NOTE: Only protocols should generally call this service
+
+#define PROTOTYPE_SELFTYPING_OFF 0
+#define PROTOTYPE_SELFTYPING_ON 1
+
#define MS_PROTO_SELFISTYPING "Proto/SelfIsTyping"
-#define PROTOTYPE_CONTACTTYPING_OFF 0
-#define PROTOTYPE_CONTACTTYPING_INFINITE 2147483647
+/////////////////////////////////////////////////////////////////////////////////////////
// This service is for notifying message dialogs/other plugins of a user typing. v0.3.3+
// This is typically sent by a protocol when a user in the clist is typing.
// wParam = (MCONTACT)hContact
@@ -266,8 +253,13 @@ __forceinline char* GetContactProto(MCONTACT hContact) // how long to display its notification. If time is 0, then notification
// of typing ends.
// NOTE: Only protocols should generally call this service
+
+#define PROTOTYPE_CONTACTTYPING_OFF 0
+#define PROTOTYPE_CONTACTTYPING_INFINITE 2147483647
+
#define MS_PROTO_CONTACTISTYPING "Proto/ContactIsTyping"
+/////////////////////////////////////////////////////////////////////////////////////////
// This hook notifies when a user is typing. If a message dialog supports sending v0.3.3+
// typing notifications it should hook this event and fire the
// ProtoService PSS_USERISTYPING to the contacts protocol *after* verifying
@@ -275,6 +267,7 @@ __forceinline char* GetContactProto(MCONTACT hContact) // to this user (checked visibility, individual typing blocking, etc).
// wParam = (MCONTACT)hContact
// lParam = (LPARAM)(int)typing state
+
#define ME_PROTO_CONTACTISTYPING "Proto/ContactIsTypingEvent"
// -------------- accounts support --------------------- 0.8.0+
@@ -299,19 +292,19 @@ typedef struct tagACCOUNT }
PROTOACCOUNT;
+/////////////////////////////////////////////////////////////////////////////////////////
// account enumeration service
// wParam = (WPARAM)(int*)piNumAccounts
// lParam = (LPARAM)(PROTOACCOUNT**)paAccounts
-#define MS_PROTO_ENUMACCOUNTS "Proto/EnumAccounts"
-__forceinline INT_PTR ProtoEnumAccounts(int* accNumber, PROTOACCOUNT*** accArray)
-{ return CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)accNumber, (LPARAM)accArray);
-}
+MIR_APP_DLL(void) Proto_EnumAccounts(int *nAccs, PROTOACCOUNT ***pAccs);
+/////////////////////////////////////////////////////////////////////////////////////////
// creates new account
// wParam = 0
// lParam = (LPARAM)(ACC_CREATE*) account definition
// return value = PROTOACCOUNT* or NULL
+
#define MS_PROTO_CREATEACCOUNT "Proto/CreateAccount"
typedef struct tagACC_CREATE
@@ -325,17 +318,13 @@ __forceinline PROTOACCOUNT* ProtoCreateAccount(ACC_CREATE *pAccountDef) { return (PROTOACCOUNT*)CallService(MS_PROTO_CREATEACCOUNT, 0, (LPARAM)pAccountDef);
}
+/////////////////////////////////////////////////////////////////////////////////////////
// retrieves an account's interface by its physical name (database module)
-// wParam = 0
-// lParam = (LPARAM)(char*)szAccountName
// return value = PROTOACCOUNT* or NULL
-#define MS_PROTO_GETACCOUNT "Proto/GetAccount"
-__forceinline PROTOACCOUNT* ProtoGetAccount(const char* accName)
-{
- return (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)accName);
-}
+EXTERN_C MIR_APP_DLL(PROTOACCOUNT*) Proto_GetAccount(const char *pszModuleName);
+/////////////////////////////////////////////////////////////////////////////////////////
// this event is fired when the accounts list gets changed
// wParam = event type (1 - added, 2 - changed, 3 - deleted, 4 - upgraded, 5 - enabled/disabled)
// lParam = (LPARAM)(PROTOACCOUNT*) - account being changed
@@ -348,37 +337,37 @@ __forceinline PROTOACCOUNT* ProtoGetAccount(const char* accName) #define ME_PROTO_ACCLISTCHANGED "Proto/AccListChanged"
+/////////////////////////////////////////////////////////////////////////////////////////
// displays the Account Manager
// wParam = 0
// lParam = 0
+
#define MS_PROTO_SHOWACCMGR "Protos/ShowAccountManager"
+/////////////////////////////////////////////////////////////////////////////////////////
// determines if an account is enabled or not
// wParam = 0
// lParam = (LPARAM)(PROTOACCOUNT*)
// Returns 1 if an account is valid and enabled, 0 otherwise
-#define MS_PROTO_ISACCOUNTENABLED "Proto/IsAccountEnabled"
-__forceinline int IsAccountEnabled(const PROTOACCOUNT *pa)
-{
- return (int)CallService(MS_PROTO_ISACCOUNTENABLED, 0, (LPARAM)pa);
-}
+EXTERN_C MIR_APP_DLL(bool) Proto_IsAccountEnabled(const PROTOACCOUNT *pa);
+/////////////////////////////////////////////////////////////////////////////////////////
// determines if an account is locked or not
// wParam = 0
// lParam = (LPARAM)(char*)szAccountName
// Returns 1 if an account is locked and not supposed to change status, 0 otherwise
-#define MS_PROTO_ISACCOUNTLOCKED "Proto/IsAccountLocked"
+EXTERN_C MIR_APP_DLL(bool) Proto_IsAccountLocked(const char *szModuleName);
+/////////////////////////////////////////////////////////////////////////////////////////
// gets the account associated with a contact
-// wParam = (MCONTACT)hContact
-// lParam = 0
// Returns a char* pointing to the asciiz name of the protocol or NULL if the
// contact has no protocol. There is no need to mir_free() it or anything.
// This is the name of the module that actually accesses the network for that
// contact.
-#define MS_PROTO_GETCONTACTBASEACCOUNT "Proto/GetContactBaseAccount"
+
+EXTERN_C MIR_APP_DLL(char*) Proto_GetBaseAccountName(MCONTACT);
/* -------------- avatar support ---------------------
@@ -446,4 +435,66 @@ typedef struct { #define PS_GETAVATARINFO "/GetAvatarInformation"
+/////////////////////////////////////////////////////////////////////////////////////////
+// notify the protocol manager that you're around
+// wParam = 0
+// lParam = (PROTOCOLDESCRIPTOR*)&descriptor
+// returns 0 on success, nonzero on failure
+// This service must be called in your module's Load(void) routine.
+// descriptor.type can be a value other than the PROTOTYPE_ constants specified
+// above to provide more precise positioning information for the contact
+// protocol lists. It is strongly recommended that you give values relative to
+// the constants, however, by adding or subtracting small integers ( <= 100).
+// PROTOTYPE_PROTOCOL modules must not do this. The value must be exact.
+// See MS_PROTO_ENUMPROTOCOLS for more notes.
+
+EXTERN_C MIR_APP_DLL(int) Proto_RegisterModule(PROTOCOLDESCRIPTOR*);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// adds the specified protocol module to the chain for a contact
+// returns 0 on success, nonzero on failure
+// The module is added in the correct position according to the type given when
+// it was registered.
+
+EXTERN_C MIR_APP_DLL(int) Proto_AddToContact(MCONTACT, const char *szProto);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// removes the specified protocol module from the chain for a contact
+// wParam = (MCONTACT)hContact
+// lParam = (LPARAM)(const char*)szName
+// returns 0 on success, nonzero on failure
+
+EXTERN_C MIR_APP_DLL(int) Proto_RemoveFromContact(MCONTACT, const char *szProto);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Call the next service in the chain for this send operation
+// The return value should be returned immediately
+// iOrder and ccs should be passed as the parameters that your service was
+// called with. iOrder must remain untouched but ccs is a CCSDATA structure
+// that can be copied and modified if needed.
+// Typically, the last line of any chaining protocol function is
+// return Proto_ChainSend(iOrder, ccs);
+
+EXTERN_C MIR_APP_DLL(INT_PTR) Proto_ChainSend(int iOrder, CCSDATA *ccs);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Call the next service in the chain for this receive operation
+// The return value should be returned immediately
+// iOrder and ccs should be passed as the parameters that your service was
+// called with. iOrder must remain untouched but ccs is a CCSDATA structure
+// that can be copied and modified if needed.
+// When being initiated by the network-access protocol module, wParam should be zero.
+// Thread safety: ms_proto_chainrecv is completely thread safe since 0.1.2.0
+// Calls to it are translated to the main thread and passed on from there. The
+// function will not return until all callees have returned, irrepective of
+// differences between threads the functions are in.
+
+EXTERN_C MIR_APP_DLL(INT_PTR) Proto_ChainRecv(int iOrder, CCSDATA *ccs);
+
+__forceinline INT_PTR ProtoChainRecv(MCONTACT hContact, char *szService, WPARAM wParam, LPARAM lParam)
+{
+ CCSDATA ccs = { hContact, szService, wParam, lParam };
+ return Proto_ChainRecv(0, &ccs);
+}
+
#endif // M_PROTOCOLS_H
diff --git a/include/m_protoint.h b/include/m_protoint.h index fc2171ad32..515372d603 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define M_PROTOINT_H__ 1
#include <m_system_cpp.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_database.h>
#include <m_utils.h>
diff --git a/include/m_protomod.h b/include/m_protomod.h deleted file mode 100644 index 2a4abf55d6..0000000000 --- a/include/m_protomod.h +++ /dev/null @@ -1,113 +0,0 @@ -/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org)
-Copyright (c) 2000-08 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-//this module was created in v0.1.1.0
-
-//this header file is for the use of protocol modules only. Other users should
-//use the functions exposed in m_protocols.h and m_protosvc.h
-
-#ifndef M_PROTOMOD_H__
-#define M_PROTOMOD_H__ 1
-
-#include <stdio.h>
-
-#include <m_protocols.h>
-#include <m_protosvc.h>
-
-//notify the protocol manager that you're around
-//wParam = 0
-//lParam = (PROTOCOLDESCRIPTOR*)&descriptor
-//returns 0 on success, nonzero on failure
-//This service must be called in your module's Load(void) routine.
-//descriptor.type can be a value other than the PROTOTYPE_ constants specified
-//above to provide more precise positioning information for the contact
-//protocol lists. It is strongly recommended that you give values relative to
-//the constants, however, by adding or subtracting small integers ( <= 100).
-//PROTOTYPE_PROTOCOL modules must not do this. The value must be exact.
-//See MS_PROTO_ENUMPROTOCOLS for more notes.
-#define MS_PROTO_REGISTERMODULE "Proto/RegisterModule"
-
-//adds the specified protocol module to the chain for a contact
-//wParam = (MCONTACT)hContact
-//lParam = (LPARAM)(const char*)szName
-//returns 0 on success, nonzero on failure
-//The module is added in the correct position according to the type given when
-//it was registered.
-#define MS_PROTO_ADDTOCONTACT "Proto/AddToContact"
-
-//removes the specified protocol module from the chain for a contact
-//wParam = (MCONTACT)hContact
-//lParam = (LPARAM)(const char*)szName
-//returns 0 on success, nonzero on failure
-#define MS_PROTO_REMOVEFROMCONTACT "Proto/RemoveFromContact"
-
-//Call the next service in the chain for this send operation
-//wParam = wParam
-//lParam = lParam
-//The return value should be returned immediately
-//wParam and lParam should be passed as the parameters that your service was
-//called with. wParam must remain untouched but lParam is a CCSDATA structure
-//that can be copied and modified if needed.
-//Typically, the last line of any chaining protocol function is
-//return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
-#define MS_PROTO_CHAINSEND "Proto/ChainSend"
-
-//Call the next service in the chain for this receive operation
-//wParam = wParam
-//lParam = lParam
-//The return value should be returned immediately
-//wParam and lParam should be passed as the parameters that your service was
-//called with. wParam must remain untouched but lParam is a CCSDATA structure
-//that can be copied and modified if needed.
-//When being initiated by the network-access protocol module, wParam should be
-//zero.
-//Thread safety: ms_proto_chainrecv is completely thread safe since 0.1.2.0
-//Calls to it are translated to the main thread and passed on from there. The
-//function will not return until all callees have returned, irrepective of
-//differences between threads the functions are in.
-#define MS_PROTO_CHAINRECV "Proto/ChainRecv"
-
-__forceinline INT_PTR ProtoChainRecv(MCONTACT hContact, char *szService, WPARAM wParam, LPARAM lParam)
-{ CCSDATA ccs = { hContact, szService, wParam, lParam };
- return CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
-}
-
-__forceinline INT_PTR ProtoChainRecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
-{ CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)pre };
- return CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
-}
-
-__forceinline INT_PTR ProtoChainRecvFile(MCONTACT hContact, PROTORECVFILET *pre)
-{ CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)pre };
- return CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
-}
-
-//Broadcast a ME_PROTO_ACK event
-//wParam = 0
-//lParam = (LPARAM)(ACKDATA*)&ack
-//returns the return value of the notifyeventhooks() call
-//Thread safety: me_proto_ack is completely thread safe since 0.1.2.0
-//See the notes in core/modules.h under NotifyEventHooks()
-#define MS_PROTO_BROADCASTACK "Proto/BroadcastAck"
-
-#endif // M_PROTOMOD_H__
diff --git a/include/m_protosvc.h b/include/m_protosvc.h index b4de5bff4d..510f361364 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -794,6 +794,12 @@ __forceinline INT_PTR Proto_RecvMessage(MCONTACT hContact, PROTORECVEVENT *pcre) return CallService(MS_PROTO_RECVMSG, 0, (LPARAM)&ccs);
}
+__forceinline INT_PTR ProtoChainRecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
+{
+ CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)pre };
+ return Proto_ChainRecv(0, &ccs);
+}
+
///////////////////////////////////////////////////////////////////////////////
// Proto/AuthRecv
// Copies the EVENTTYPE_AUTHREQUEST event from PROTORECVEVENT into DBEVENTINFO and adds it
@@ -840,6 +846,12 @@ __forceinline INT_PTR Proto_RecvFile(MCONTACT hContact, PROTORECVFILET *pcre) return CallService(MS_PROTO_RECVFILET, 0, (LPARAM)&ccs);
}
+__forceinline INT_PTR ProtoChainRecvFile(MCONTACT hContact, PROTORECVFILET *pre)
+{
+ CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)pre };
+ return Proto_ChainRecv(0, &ccs);
+}
+
///////////////////////////////////////////////////////////////////////////////
// An URL has been received
// wParam = 0
diff --git a/langpacks/german/=CORE=.txt b/langpacks/german/=CORE=.txt index 45fc528819..71528cd553 100644 --- a/langpacks/german/=CORE=.txt +++ b/langpacks/german/=CORE=.txt @@ -2567,8 +2567,7 @@ Geändert Meine Profile
[New profile]
Neues Profil
-;file \src\mir_app\src\protocolorder.cpp
-;file \src\mir_app\src\protoopts.cpp
+;file \src\mir_app\src\proto_opts.cpp
[WARNING! The account is going to be deleted. It means that all its settings, contacts and histories will be also erased.\n\nAre you absolutely sure?]
WARNUNG! Das Konto wird gelöscht. Das heißt, dass all seine Einstellungen, Kontakte und Verläufe ebenfalls gelöscht werden.\n\nSind Sie sich absolut sicher?
[Your account was successfully upgraded. To activate it, restart of Miranda is needed.\n\nIf you want to restart Miranda now, press Yes, if you want to upgrade another account, press No]
@@ -2619,6 +2618,10 @@ Konto %s wird gelöscht Um dieses Konto zu loschen, mussen Sie das dazugehorige Plugin deaktivieren
[&Accounts...]
&Konten...
+;file \src\mir_app\src\proto_order.cpp
+;file \src\mir_app\src\proto_ui.cpp
+[Account]
+Konto
;file \src\mir_app\src\searchresults.cpp
[Could not start a search on '%s', there was a problem - is %s connected?]
Miranda kann für das Protokoll '%s' keine Suche starten, ist das Protokoll %s online?
@@ -3237,6 +3240,3 @@ JPEG-Bilder GIF-Bilder
[PNG bitmaps]
PNG-Bilder
-;file \src\mir_core\src\ui_utils.cpp
-[Account]
-Konto
diff --git a/langpacks/german/Plugins/DbEditorPP.txt b/langpacks/german/Plugins/DbEditorPP.txt index e248647abe..9097bb5273 100644 --- a/langpacks/german/Plugins/DbEditorPP.txt +++ b/langpacks/german/Plugins/DbEditorPP.txt @@ -2,42 +2,36 @@ ;============================================================
; File: DbEditorPP.dll
; Plugin: Database editor++
-; Version: 3.2.0.2
+; Version: 4.0.0.0
; Authors: Bio, Jonathan Gordon
;============================================================
[Advanced Database Editor.]
Erweiterter Datenbank-Editor.
;file \plugins\DbEditorPP\res\resource.rc
-[Database Editor++ search and replace]
-Datenbank-Editor++ Suchen und Ersetzen
+[Search and replace]
+
[Search for]
Suchen nach
-[Text:]
-Text:
-[In:]
-In:
-[Case sensitive]
-Groß-/Kleinschreibung
-[Module name]
-Modul Name
[Exact match]
genaue Suche
+[&Search]
+&Suchen
+[Module name]
+Modul Name
[Setting name]
Einstell. Name
[Setting value]
Einstell. Wert
-[&Search]
-&Suchen
+[Case sensitive]
+Groß-/Kleinschreibung
+[&Cancel]
+Abbre&chen
[Replace with]
Ersetzen durch
[Entirely]
Komplett
-[Found field]
-Feld gefunden
[&Replace]
E&rsetzen
-[&Cancel]
-Abbre&chen
[Restore last opened position]
Zuletzt geöffnete Position wiederherstellen
[Automatically expand "Settings" when Database Editor++ starts]
@@ -60,10 +54,10 @@ Zu allen Kontakten hinzufügen (inkl. Einstell.) Abbrechen
[Edit setting]
Einstellung ändern
-[Value name:]
-Wertname:
-[Value data:]
-Wertdatum:
+[Name]
+Name
+[Value]
+Wert
[Base]
Basis
[Hexadecimal]
@@ -88,14 +82,10 @@ Modul zu Kontakt kopieren Modul und Einstellungen kopieren zu Kontakt:
[Copy to all contacts (including Settings)]
Zu allen Kontakten kopieren (inkl. Einstell.)
-[Import module/settings]
-Module/Einstellungen importieren
-[Paste the settings to import here.]
-Zu importierende Einstellungen hier einfügen.
[Import]
Importieren
-[Insert &CR/LF]
-Zeilenumbru&ch
+[Paste the settings to import here:]
+
[Database Editor++]
Datenbank-Editor++
[&Main]
@@ -110,6 +100,8 @@ B&eenden &Aktionen
[&Search and replace]
&Suchen und ersetzen
+[&Fix resident settings]
+
[&Delete module]
Modul &löschen
[&Watches]
@@ -148,14 +140,20 @@ Nur &ungeladene anzeigen &Words in Hex bearbeiten
[Edit &Dwords in Hex]
&DWords in Hex bearbeiten
+[&Inline edit]
+
[&Restore position]
Position wiederhe&rstellen
[&Open options]
Einstellungen &öffnen
-[&Edit/rename]
-B&earbeiten/Umbenennen
-[New]
-Neu
+[&Edit]
+B&earbeiten
+[&Copy]
+&Kopieren
+[&Delete]
+&Löschen
+[Convert to]
+
[&Byte]
&Byte
[&Word]
@@ -166,30 +164,22 @@ Neu &String
[&Unicode]
&Unicode
+[New]
+Neu
[BL&OB]
BL&OB
-[&Convert to]
-Umwandeln zu
-[Encyption]
-Verschlüsselung
-[View decrypted string]
-Entschlüsselten String anzeigen
-[View encrypted string]
-Verschlüsselten String anzeigen
-[Decrypt string]
-String entschlüsseln
-[Encrypt string]
-String verschlüsseln
[&Watch]
&Beobachten
-[&Delete]
-&Löschen
+[&Refresh]
+Aktualisie&ren
[&Rename]
&Umbenennen
[Copy to contact]
Zu Kontakt kopieren
[Export module]
Modul exportieren
+[&Add module]
+Modul &hinzufügen
[&Clone]
&Kopie erstellen
[Export contact]
@@ -200,8 +190,6 @@ Einstellungen importieren Von einer Datei
[From pasted text]
Vom eingefügten Text
-[&Add module]
-Modul &hinzufügen
[Export settings]
Einstellungen exportieren
[Export contacts]
@@ -214,43 +202,12 @@ Modul von allen Kontakten exportieren Beobachtungsliste
[Reload watch list]
Beobachtungsliste aktualisieren
-;file \plugins\DbEditorPP\src\addeditsettingsdlg.cpp
-[Cannot Convert!]
-Kann nicht konvertieren!
-[New BYTE value]
-Neuer BYTE-Wert
-[Edit BYTE value]
-BYTE-Wert bearbeiten
-[New WORD value]
-Neuer WORD-Wert
-[Edit WORD value]
-WORD-Wert bearbeiten
-[New DWORD value]
-Neuer DWORD-Wert
-[Edit DWORD value]
-DWORD-Wert bearbeiten
-[New STRING value]
-Neuer STRING-Wert
-[Edit STRING value]
-STRING-Wert bearbeiten
-[New UNICODE value]
-Neuer UNICODE-Wert
-[Edit UNICODE value]
-UNICODE-Wert bearbeiten
-[New BLOB value]
-Neuer BLOB-Wert
-[Edit BLOB value]
-BLOB-Wert bearbeiten
-[Couldn't allocate enough memory!]
-Nicht genug freier Speicher!
;file \plugins\DbEditorPP\src\copymodule.cpp
-[Settings]
-Einstellungen
+[Copy module "%s"]
+
;file \plugins\DbEditorPP\src\deletemodule.cpp
[Are you sure you want to delete module "%s"?]
Soll Modul "%s" wirklich gelöscht werden?
-[Confirm module deletion]
-Modullöschung bestätigen
[Delete module from database]
Modul aus der Datenbank löschen
[Delete module from database... Loading]
@@ -264,48 +221,44 @@ INI-Dateien Alle Dateien
[Export to file]
Exportieren
-[Error loading module list]
-Fehler beim Laden der Modulliste
[Couldn't open file for writing]
Konnte nicht in Datei schreiben
+[Import to "%s"]
+
[Import from files]
Import aus Dateien
;file \plugins\DbEditorPP\src\findwindow.cpp
+[Result]
+Ergebnis
+[Contact]
+Kontakt
+[Module]
+Modul
+[Setting]
+Einstellung
[Enter a string to search the database for]
Geben Sie einen Suchstring für die Datenbank ein
[Stop]
Stopp
-[Replaced with]
-Ersetzt durch
+[Replaced]
+
[Deleted]
Gelöscht
[Found]
Gefunden
-[%s Module "%s" in contact "%s"]
-%s Modul "%s" in Kontakt "%s"
-[%s Setting "%s" in module "%s" in contact "%s" - "%s"]
-%s Einstellung "%s" in Modul "%s" in Kontakt "%s" - "%s"
-[%s Setting "%s" in module "%s" in contact "%s"]
-%s Einstellung "%s" in Modul "%s" in Kontakt "%s"
-[%s "%s" in Setting "%s" in module "%s" in contact "%s"]
-%s "%s" in Einstellung "%s" in Modul "%s" in Kontakt "%s"
[Searching...]
Suche...
-[Error Loading Setting List]
-Fehler beim Laden der Einstellungsliste
-[Finished. %d items were found, %d items were deleted.]
-Beendet. %d Einträge wurden gefunden, %d Einträge wurden gelöscht.
-[Finished. %d items were found, %d items were replaced.]
-Beendet. %d Einträge wurden gefunden, %d Einträge wurden ersetzt.
-[Finished. %d items were found.]
-Beendet. %d Einträge wurden gefunden.
+[Finished. Items found: %d / replaced: %d / deleted: %d]
+
;file \plugins\DbEditorPP\src\icons.cpp
[Main icon]
Haupticon
-[Closed known module]
-Geschlossenes bekanntes Modul
-[Open known module]
-Offenes bekanntes Modul
+[Closed module]
+
+[Open module]
+
+[Settings]
+Einstellungen
[Contacts group]
Kontaktgruppe
[Unknown contact]
@@ -314,6 +267,8 @@ Unbekannter Kontakt Bekannter Kontakt
[Open user tree]
Benutzerzweig öffnen
+[Empty setting]
+
[BLOB setting]
BLOB-Eintrag
[Byte setting]
@@ -333,73 +288,57 @@ Handle Öffne Datenbank-Editor++
[Open user tree in DBE++]
Benutzerzweig in DBE++ öffnen
+[<UNKNOWN>]
+<unbekannt>
+[[UNLOADED]]
+
;file \plugins\DbEditorPP\src\main_window.cpp
[Are you sure you want to delete contact "%s"?]
Soll Kontakt "%s" wirklich gelöscht werden?
-[Confirm contact delete]
-Kontaktlöschung bestätigen
-;file \plugins\DbEditorPP\src\modules.cpp
+[Fix resident setting deleting them from DB ?]
+
+[Deleted orphaned items: %d]
+
+;file \plugins\DbEditorPP\src\modsettingenum.cpp
+[Error loading module list]
+Fehler beim Laden der Modulliste
+[Error loading setting list]
+Fehler beim Laden der Einstellungsliste
;file \plugins\DbEditorPP\src\moduletree.cpp
[Loading contacts...]
Lade Kontakte...
[Loading modules...]
Lade Module...
-[Module tree not found]
-Modulbaum nicht gefunden
[Contacts]
Kontakte
-[HANDLE]
-HANDLE
-[Add module to contact "%s"]
-Modul zum Kontakt "%s" hinzufügen
;file \plugins\DbEditorPP\src\options.cpp
[Database]
Datenbank
+;file \plugins\DbEditorPP\src\renamemodule.cpp
+[Add module to "%s"]
+
;file \plugins\DbEditorPP\src\settinglist.cpp
-[Name]
-Name
-[Data]
-Wert
[Type]
Typ
[Size]
Größe
+[Unable to store value in this data type!]
+
+[Are you sure you want to delete setting(s): %d?]
+
[*** encrypted ***]
*** verschlüsselt ***
-[UNICODE]
-UNICODE
-[BLOB]
-BLOB
-[BYTE]
-BYTE
-[WORD]
-WORD
-[DWORD]
-DWORD
-[STRING]
-STRING
-[<unsupported>]
-<nicht unterstützt>
-[<unknown>]
-<unbekannt>
-[Decoded string..]
-Dekodierte Zeichenkette..
-[Encoded string..]
-Kodierte Zeichenkette..
+[*** buggy resident ***]
+
+;file \plugins\DbEditorPP\src\settingsdlg.cpp
+[Unknown DBVariant type!]
+
+[Edit setting (%s)]
+
+[New setting (%s)]
+
;file \plugins\DbEditorPP\src\watchedvars.cpp
-[Contact]
-Kontakt
-[Module]
-Modul
-[Setting]
-Einstellung
-[Database Setting Changed: \nModule: "%s" , Setting: "%s"\nNew Value: (BYTE) %d]
-Datenbankeinstellung geändert:\nModul: "%s" , Einstellung: "%s"\nNeuer Wert: (BYTE) %d
-[Database Setting Changed: \nModule: "%s" , Setting: "%s"\nNew Value: (WORD) %d]
-Datenbankeinstellung geändert:\nModul: "%s" , Einstellung: "%s"\nNeuer Wert: (WORD) %d
-[Database Setting Changed: \nModule: "%s" , Setting: "%s"\nNew Value: (DWORD) 0x%X]
-Datenbankeinstellung geändert: \nModul: "%s" , Einstellung: "%s"\nNeuer Wert: (DWORD) 0x%X
-[Database Setting Changed: \nModule: "%s" , Setting: "%s"\nNew Value: "%s"]
-Datenbankeinstellung geändert: \nModul: "%s" , Einstellung: "%s"\nNeuer Wert: "%s"
-[Database Setting Changed: \nModule: "%s" , Setting: "%s"\nNew Value (UTF8): "%s"]
-Datenbankeinstellung geändert: \nModul: "%s" , Einstellung: "%s"\nNeuer Wert (UTF8): "%s"
+[*** resident ***]
+
+[Database Setting Changed: \nModule: "%s", Setting: "%s"\nNew Value (%s): "%s"]
+
diff --git a/langpacks/german/Plugins/MirLua.txt b/langpacks/german/Plugins/MirLua.txt index 7e192e5692..6a03ca5248 100644 --- a/langpacks/german/Plugins/MirLua.txt +++ b/langpacks/german/Plugins/MirLua.txt @@ -7,6 +7,9 @@ ;============================================================
[Allow you to extend Miranda NG functionality with lua scripts.]
Erlaubt es, die Funktionalität von Miranda NG durch Lua-Skripte zu erweitern
+;file \plugins\MirLua\res\resource.rc
+[Reload]
+Neu laden
;file \plugins\MirLua\src\main.cpp
[Customize]
Customize
diff --git a/langpacks/german/Plugins/SkypeWeb.txt b/langpacks/german/Plugins/SkypeWeb.txt index 3909c4a04f..e74c157937 100644 --- a/langpacks/german/Plugins/SkypeWeb.txt +++ b/langpacks/german/Plugins/SkypeWeb.txt @@ -2,7 +2,7 @@ ;============================================================
; File: SkypeWeb.dll
; Plugin: Skype protocol (Web)
-; Version: 0.12.1.1
+; Version: 0.12.1.2
; Authors: Miranda NG Team
;============================================================
[Skype protocol support for Miranda NG. Based on new Skype for Web.]
diff --git a/langpacks/german/Plugins/VKontakte.txt b/langpacks/german/Plugins/VKontakte.txt index f7a0a0d03c..66c06a2798 100644 --- a/langpacks/german/Plugins/VKontakte.txt +++ b/langpacks/german/Plugins/VKontakte.txt @@ -2,7 +2,7 @@ ;============================================================
; File: VKontakte.dll
; Plugin: VKontakte protocol
-; Version: 0.1.1.5
+; Version: 0.1.1.7
; Authors: Miranda NG Team
;============================================================
[VKontakte protocol support for Miranda NG.]
@@ -32,6 +32,8 @@ Sonstige BBCode-Unterstützung für Anhänge
[Process stickers as smileys]
Sticker als Smileys darstellen
+[Shorten links for audio attachments]
+
[News and event notifications]
Neuigkeiten- und Ereignisbenachrichtigungen
[WARNING: Causes excessive network traffic!!!]
@@ -303,6 +305,8 @@ Benutzer gekickt Chat verlassen
[invite user]
Benutzer eingeladen
+[returned to chat]
+
[change chat title to]
Chatthema geändert zu
[chat action not supported]
@@ -329,6 +333,8 @@ Benutzer e&inladen Raum &zerstören
[&User details]
Kontakt&profil
+[Visit profile]
+Profil ansehen
[&Kick]
&Kick
;file \protocols\VKontakte\src\vk_feed.cpp
@@ -390,8 +396,6 @@ Statusnachricht Nachricht auf meine Pinnwand senden
[Load news from VK]
Neuigkeiten von VK laden
-[Visit profile]
-Profil ansehen
[Send message to user\'s wall]
Nachricht auf Pinnwand des Benutzers senden
[Add as friend]
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 93a2d008e8..d551874527 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -336,14 +336,14 @@ static int ModulesLoaded(WPARAM, LPARAM) int accCount;
PROTOACCOUNT **accs = NULL;
- ProtoEnumAccounts(&accCount, &accs);
+ Proto_EnumAccounts(&accCount, &accs);
if (fei != NULL) {
LoadDefaultInfo();
int protoCount;
PROTOCOLDESCRIPTOR **proto;
- CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&proto);
+ Proto_EnumProtocols(&protoCount, &proto);
for (int i = 0; i < protoCount; i++)
LoadProtoInfo(proto[i]);
for (int i = 0; i < accCount; i++)
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 9e1f3a45f3..0f7793b45f 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -75,7 +75,7 @@ static void RemoveProtoPic(const char *szProto) if (p.szProtoname == NULL) continue; - PROTOACCOUNT *pdescr = ProtoGetAccount(p.szProtoname); + PROTOACCOUNT *pdescr = Proto_GetAccount(p.szProtoname); if (pdescr == NULL && mir_strcmp(p.szProtoname, szProto)) continue; @@ -140,7 +140,7 @@ static void SetProtoPic(char *szProto) mir_strncpy(szProtoname, szProto, mir_strlen(szProto) - mir_strlen("accounts")); mir_strcpy(szProtoname, strrchr(szProtoname, ' ') + 1); for (int i = 0; i < g_ProtoPictures.getCount(); i++) { - PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)g_ProtoPictures[i].szProtoname); + PROTOACCOUNT* pdescr = Proto_GetAccount(g_ProtoPictures[i].szProtoname); if (pdescr == NULL && mir_strcmp(g_ProtoPictures[i].szProtoname, szProto)) continue; @@ -1008,7 +1008,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP PROTOACCOUNT **accs; int count, num = 0; - ProtoEnumAccounts(&count, &accs); + Proto_EnumAccounts(&count, &accs); for (int i = 0; i < count; i++) { if (!ProtoServiceExists(accs[i]->szModuleName, PS_GETMYAVATAR)) continue; diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 1f3fd7441b..5162f283f6 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -225,7 +225,7 @@ static int InternalRemoveMyAvatar(char *protocol) PROTOACCOUNT **accs;
int i, count;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (i = 0; i < count; i++) {
if (!ProtoServiceExists(accs[i]->szModuleName, PS_SETMYAVATAR))
continue;
@@ -528,7 +528,7 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo else {
int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
if (!ProtoServiceExists(accs[i]->szModuleName, PS_SETMYAVATAR))
continue;
@@ -635,7 +635,7 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath) int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
if (!ProtoServiceExists(accs[i]->szModuleName, PS_SETMYAVATAR))
continue;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index a1863a9f42..030696b7fc 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -99,7 +99,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) MyPathToAbsolute(tszValue, tszFilename);
if (!strstr(szProto, "Global avatar for")) {
- PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)szProto);
+ PROTOACCOUNT* pdescr = Proto_GetAccount(szProto);
if (pdescr == NULL)
return -1;
char key[MAX_PATH];
diff --git a/plugins/Actman/iac_contact.pas b/plugins/Actman/iac_contact.pas index 55afcfba2f..7c17334f15 100644 --- a/plugins/Actman/iac_contact.pas +++ b/plugins/Actman/iac_contact.pas @@ -116,7 +116,7 @@ var is_chat:boolean;
begin
result:=0;
- proto:=GetContactProtoAcc(hContact);
+ proto:=Proto_GetBaseAccountName(hContact);
if proto<>nil then
begin
is_chat:=IsChat(hContact);
diff --git a/plugins/Actman/iac_dbrw.pas b/plugins/Actman/iac_dbrw.pas index 7ddbe0b61c..f9faa18293 100644 --- a/plugins/Actman/iac_dbrw.pas +++ b/plugins/Actman/iac_dbrw.pas @@ -175,7 +175,7 @@ begin IntToStr(sbuf,WorkData.LastResult);
end;
- proto:=GetContactProtoAcc(hContact);
+ proto:=Proto_GetBaseAccountName(hContact);
// now need to process module
if (flags and ACF_RW_MODULE)<>0 then
begin
diff --git a/plugins/Actman/iac_inout.pas b/plugins/Actman/iac_inout.pas index a9930797ab..5ae7a1cedf 100644 --- a/plugins/Actman/iac_inout.pas +++ b/plugins/Actman/iac_inout.pas @@ -268,7 +268,7 @@ begin if hContact=0 then exit;
- p:=GetContactProtoAcc(hContact);
+ p:=Proto_GetBaseAccountName(hContact);
if DBReadByte(hContact,p,'ChatRoom',0)<>1 then
begin
WidetoUTF8(last,blob);
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index b56d2f7ce0..a318776dfe 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -89,9 +89,9 @@ bool AddContactDlgAccounts(HWND hdlg, AddDialogParam *acs) PROTOACCOUNT** pAccounts;
int iRealAccCount, iAccCount = 0;
- ProtoEnumAccounts(&iRealAccCount, &pAccounts);
+ Proto_EnumAccounts(&iRealAccCount, &pAccounts);
for (int i = 0; i < iRealAccCount; i++) {
- if (!IsAccountEnabled(pAccounts[i]))
+ if (!Proto_IsAccountEnabled(pAccounts[i]))
continue;
DWORD dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
@@ -120,7 +120,7 @@ bool AddContactDlgAccounts(HWND hdlg, AddDialogParam *acs) HDC hdc = GetDC(hdlg);
SelectObject(hdc, (HFONT)SendDlgItemMessage(hdlg, IDC_PROTO, WM_GETFONT, 0, 0));
for (int i = 0; i < iRealAccCount; i++) {
- if (!IsAccountEnabled(pAccounts[i])) continue;
+ if (!Proto_IsAccountEnabled(pAccounts[i])) continue;
DWORD dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (!(dwCaps & PF1_BASICSEARCH) && !(dwCaps & PF1_EXTSEARCH) && !(dwCaps & PF1_SEARCHBYEMAIL) && !(dwCaps & PF1_SEARCHBYNAME))
continue;
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index a23b231be3..d134effb4d 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -76,9 +76,9 @@ static int OnAccListChanged(WPARAM, LPARAM) PROTOACCOUNT** pAccounts;
int iRealAccCount, iAccCount = 0;
- ProtoEnumAccounts(&iRealAccCount, &pAccounts);
+ Proto_EnumAccounts(&iRealAccCount, &pAccounts);
for (int i = 0; i < iRealAccCount; i++) {
- if (!IsAccountEnabled(pAccounts[i]))
+ if (!Proto_IsAccountEnabled(pAccounts[i]))
continue;
DWORD dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h index ca28dbf879..dc0eac1ba0 100644 --- a/plugins/Alarms/src/stdafx.h +++ b/plugins/Alarms/src/stdafx.h @@ -11,7 +11,7 @@ #include <m_utils.h>
#include <m_options.h>
#include <m_skin.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_popup.h>
#include <m_idle.h>
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 4b0ada0354..207cdbaad2 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -54,10 +54,11 @@ static bool AnyProtoHasCaps(DWORD caps1) {
int nProtoCount;
PROTOACCOUNT **protos;
- if (!ProtoEnumAccounts(&nProtoCount, &protos))
- for(int i=0;i<nProtoCount;++i)
- if (CallProtoService(protos[i]->szModuleName,PS_GETCAPS,(WPARAM)PFLAGNUM_1,0)&caps1)
- return true; /* CALLSERVICE_NOTFOUND also handled gracefully */
+ Proto_EnumAccounts(&nProtoCount, &protos);
+
+ for(int i=0;i<nProtoCount;++i)
+ if (CallProtoService(protos[i]->szModuleName,PS_GETCAPS,(WPARAM)PFLAGNUM_1,0)&caps1)
+ return true; /* CALLSERVICE_NOTFOUND also handled gracefully */
return false;
}
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index b77e6cdc18..a52f719a5b 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -185,7 +185,7 @@ void InitIcolib() {
}
-HICON LoadIconEx(int iconId, int big)
+HICON LoadIconEx(int iconId, bool big)
{
for (int i=0; i < SIZEOF(iconList); i++)
if ( iconList[i].defIconID == iconId)
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 6dcb35a69d..c1c707561e 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -434,10 +434,10 @@ std::wstring EventList::GetMyName() inline std::wstring GetProtocolName(MCONTACT hContact)
{
- char* ac = (char *)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0);
+ char* ac = Proto_GetBaseAccountName(hContact);
std::wstring proto1;
if (ac != NULL) {
- PROTOACCOUNT* acnt = ProtoGetAccount(ac);
+ PROTOACCOUNT* acnt = Proto_GetAccount(ac);
if (acnt != NULL && acnt->szModuleName != NULL) {
wchar_t* proto = mir_a2u(acnt->szProtoName);
proto1 = proto;
diff --git a/plugins/BasicHistory/src/stdafx.h b/plugins/BasicHistory/src/stdafx.h index ffeb27e3ed..12d674ff0e 100644 --- a/plugins/BasicHistory/src/stdafx.h +++ b/plugins/BasicHistory/src/stdafx.h @@ -89,4 +89,4 @@ #define HISTORY_HK_IMPDAT 116
#define HISTORY_HK_ALLCONTACTS 117
-HICON LoadIconEx(int iconId, int big = 0);
+HICON LoadIconEx(int iconId, bool big = false);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 5f9a7314ac..61bafe3dc6 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -615,7 +615,7 @@ static TCHAR *VariablesBossKey(ARGUMENTSINFO *ai) { static int EnumProtos(WPARAM, LPARAM)
{
- ProtoEnumAccounts(&protoCount, &proto);
+ Proto_EnumAccounts(&protoCount, &proto);
delete[] oldStatus;
delete[] oldStatusMsg;
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index f445d8de7e..6d788ebe4c 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -96,7 +96,7 @@ static int OnCreateMenuItems(WPARAM, LPARAM) { int protoCount; PROTOACCOUNT** pdesc; - ProtoEnumAccounts(&protoCount, &pdesc); + Proto_EnumAccounts(&protoCount, &pdesc); for (int i = 0; i < protoCount; i++) if (ProtoServiceExists(pdesc[i]->szModuleName, PS_SETCUSTOMSTATUSEX)) @@ -179,7 +179,7 @@ void SetStatus(WORD code, StatusItem* item, char *szAccName) if (code == IDCLOSE) return; - PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)szAccName); + PROTOACCOUNT* pdescr = Proto_GetAccount(szAccName); if (pdescr == NULL) return; @@ -225,7 +225,7 @@ INT_PTR showList(WPARAM, LPARAM, LPARAM param) void addProtoStatusMenuItem(char *protoName) { - PROTOACCOUNT *pdescr = ProtoGetAccount(protoName); + PROTOACCOUNT *pdescr = Proto_GetAccount(protoName); if (pdescr == NULL) return; @@ -321,7 +321,7 @@ CSWindow::~CSWindow() void CSWindow::initIcons() { - PROTOACCOUNT *pdescr = ProtoGetAccount(m_protoName); + PROTOACCOUNT *pdescr = Proto_GetAccount(m_protoName); if (pdescr == NULL) return; @@ -471,7 +471,7 @@ void CSAMWindow::exec() void CSAMWindow::setCombo() { - PROTOACCOUNT *pdescr = ProtoGetAccount(m_parent->m_protoName); + PROTOACCOUNT *pdescr = Proto_GetAccount(m_parent->m_protoName); if (pdescr == NULL) return; @@ -567,7 +567,7 @@ void CSAMWindow::checkItemValidity() GetDlgItemText(m_handle, IDC_MESSAGE, tszInputMessage, SIZEOF(tszInputMessage)); - PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)m_parent->m_protoName); + PROTOACCOUNT *pdescr = Proto_GetAccount(m_parent->m_protoName); if (pdescr == NULL) return; diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index 1517723a09..1c5005b26f 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -117,9 +117,9 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
- if (!IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ if (!Proto_IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 2b262ff84c..bf67a5b3d8 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -474,7 +474,7 @@ TCHAR *GetProtoName(struct ClcContact *item) return proto_name;
}
- acc = ProtoGetAccount(item->proto);
+ acc = Proto_GetAccount(item->proto);
if (acc == NULL)
{
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 3cdf2a23d3..aaf414c3ad 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -482,7 +482,7 @@ static int _GetNetVisibleProtoCount() {
int i, count, netProtoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (i = 0, netProtoCount = 0; i < count; i++) {
if (pcli->pfnGetProtocolVisibility(accs[i]->szModuleName) == 0)
continue;
@@ -620,7 +620,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L int AccNum, i, siS, siV, item;
PROTOACCOUNT **acc;
- ProtoEnumAccounts(&AccNum, &acc);
+ Proto_EnumAccounts(&AccNum, &acc);
for (siS = siV = -1, i = 0; i < AccNum; i++)
{
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 4e30d4d18c..466948d15f 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -203,7 +203,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) pdnce->getName();
else if (pdnce->isUnknown && pdnce->m_cache_cszProto && pdnce->m_bProtoNotExists == TRUE && g_flag_bOnModulesLoadedCalled) {
- if (ProtoGetAccount(pdnce->m_cache_cszProto) == NULL) {
+ if (Proto_GetAccount(pdnce->m_cache_cszProto) == NULL) {
pdnce->m_bProtoNotExists = FALSE;
pdnce->getName();
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 49725c9527..a0430c6172 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -382,7 +382,7 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD) PROTOACCOUNT **acc;
int AccNum;
- ProtoEnumAccounts(&AccNum, &acc);
+ Proto_EnumAccounts(&AccNum, &acc);
// looking for the appropriate account to show its icon
int t = pcli->cycleStep;
@@ -453,7 +453,7 @@ int GetGoodAccNum(bool *bDiffers, bool *bConn) {
PROTOACCOUNT **acc;
int AccNum, i;
- ProtoEnumAccounts(&AccNum, &acc);
+ Proto_EnumAccounts(&AccNum, &acc);
if (bConn)
*bConn = FALSE;
@@ -535,7 +535,7 @@ int cliTrayIconInit(HWND hwnd) if (!szProto)
break;
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (!pa || !pa->ppro)
pcli->pfnTrayIconAdd(hwnd, NULL, NULL, CListTray_GetGlobalStatus(0, 0));
else
@@ -554,7 +554,7 @@ int cliTrayIconInit(HWND hwnd) case TRAY_ICON_MODE_ALL:
PROTOACCOUNT **acc;
int AccNum, i;
- ProtoEnumAccounts(&AccNum, &acc);
+ Proto_EnumAccounts(&AccNum, &acc);
for (i = AccNum; i--;) {
if (!acc[i]->bIsVirtual && acc[i]->bIsVisible && !acc[i]->bDynDisabled && acc[i]->ppro)
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 3f8bc898f0..8c663dfcd0 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -911,7 +911,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) if (szAccoName[0]) {
// second try to find by protocol name
- PROTOACCOUNT *acc = ProtoGetAccount(szAccoName);
+ PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
mir_sntprintf(fileFull, SIZEOF(fileFull), _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, acc->szProtoName);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
@@ -953,7 +953,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) if (szAccoName[0]) {
// second try to find by protocol name
- PROTOACCOUNT *acc = ProtoGetAccount(szAccoName);
+ PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("proto_conn_%S.dll"), acc->szProtoName);
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
@@ -1081,10 +1081,10 @@ void CLUI_DisconnectAll() {
PROTOACCOUNT **accs;
int nProtoCount;
- ProtoEnumAccounts(&nProtoCount, &accs);
+ Proto_EnumAccounts(&nProtoCount, &accs);
for (int nProto = 0; nProto < nProtoCount; nProto++)
- if (IsAccountEnabled(accs[nProto]))
+ if (Proto_IsAccountEnabled(accs[nProto]))
CallProtoService(accs[nProto]->szModuleName, PS_SETSTATUS, ID_STATUS_OFFLINE, 0);
}
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 8cd7237eb1..272daa123c 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -84,7 +84,7 @@ int GetProtoIndex(char * szName) if (szName) {
PROTOACCOUNT **accs = NULL;
int accCount = 0;
- ProtoEnumAccounts(&accCount, &accs);
+ Proto_EnumAccounts(&accCount, &accs);
for (int i = 0; i < accCount; i++)
if (!mir_strcmpi(szName, accs[i]->szModuleName))
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 0637c9a3bc..7d785529e3 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -172,7 +172,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
if (protoCount == 0)
return 0;
@@ -800,7 +800,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
bool first = true;
for (int pos = 0; pos < protoCount; pos++) {
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index acf1c22e7e..7625191703 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -163,7 +163,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)TranslateT("<<Global>>"));
SendMessage(hwndComboBox, CB_SETITEMDATA, 0, 0);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 3a73313d86..9da5d24f42 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -216,7 +216,7 @@ static int FillDialog(HWND hwnd) ListView_InsertColumn(GetDlgItem(hwnd, IDC_PROTOCOLS), 0, &lvc);
// fill protocols...
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
item.mask = LVIF_TEXT;
item.iItem = 1000;
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index 73f65a6185..291431b238 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -108,9 +108,9 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
- if (!IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ if (!Proto_IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 0b48aae08d..3561a641f8 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -265,9 +265,9 @@ static void InitIcoLib() PROTOACCOUNT **accs = NULL; int p_count = 0; - ProtoEnumAccounts(&p_count, &accs); + Proto_EnumAccounts(&p_count, &accs); for (int k = 0; k < p_count; k++) { - if (!IsAccountEnabled(accs[k]) || CallProtoService(accs[k]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0) + if (!Proto_IsAccountEnabled(accs[k]) || CallProtoService(accs[k]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0) continue; TCHAR szDescr[128]; @@ -1731,7 +1731,7 @@ buttons_done: if (showOpts & 2) { TCHAR szName[64]; - PROTOACCOUNT *pa = ProtoGetAccount(szProto); + PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa) { mir_tstrncpy(szName, pa->tszAccountName, SIZEOF(szName)); szName[SIZEOF(szName) - 1] = 0; diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 648f2b00f5..906ebbf6aa 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -73,7 +73,7 @@ void CluiProtocolStatusChanged(int, const char*) int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
if (protoCount == 0)
return;
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index cb915bdd73..7f1145226a 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -167,7 +167,7 @@ int __forceinline GetProtoIndex(char * szName) if (!szName)
return -1;
- PROTOACCOUNT *pa = ProtoGetAccount(szName);
+ PROTOACCOUNT *pa = Proto_GetAccount(szName);
return (pa == NULL) ? -1 : pa->iOrder;
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 2c9b7f4e74..4349b1130d 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -280,7 +280,7 @@ void LoadExtBkSettingsFromDB() int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
for (i = 0; i < protoCount; i++) {
StatusItems_t *p = (StatusItems_t*)mir_alloc(sizeof(StatusItems_t));
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 4d1414408c..3a89f5c938 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -178,7 +178,7 @@ static int FillDialog(HWND hwnd) // fill protocols...
- ProtoEnumAccounts( &protoCount, &accs );
+ Proto_EnumAccounts( &protoCount, &accs );
item.mask = LVIF_TEXT;
item.iItem = 1000;
for (i = 0; i < protoCount; i++) {
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 64ab262bf7..6931db6137 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -74,7 +74,7 @@ int AccountName2Protocol(const char *accountName, OUT char *uniqueProtocolName, {
int count;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
strncpy_s(uniqueProtocolName, length, accountName, _TRUNCATE);
@@ -217,7 +217,7 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep int count;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
char pn[128];
@@ -328,7 +328,7 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re char *awayMsg = argv[2];
int count = 0;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
CMStringA szReply;
int i;
@@ -1250,7 +1250,7 @@ void HandleProxyCommand(PCommand command, TArgument *argv, int argc, PReply repl int count = 0;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
int i;
int global = (mir_strcmp(protocol, "GLOBAL") == 0);
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 8dc0bc718a..2d458a31d3 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -881,7 +881,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.cbSize = sizeof(pd);
pd.szName = PLUGINNAME;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
//set all contacts to offline
for (MCONTACT hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact, PLUGINNAME))
diff --git a/plugins/ConnectionNotify/src/stdafx.h b/plugins/ConnectionNotify/src/stdafx.h index 75b64b0148..b82329e376 100644 --- a/plugins/ConnectionNotify/src/stdafx.h +++ b/plugins/ConnectionNotify/src/stdafx.h @@ -12,7 +12,6 @@ #include <m_options.h>
#include <m_popup.h>
#include <m_utils.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_system.h>
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 8cd63e612a..35153a6954 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -302,11 +302,11 @@ static void GetProtocolStrings(CMString& buffer) int accCount;
int i, j;
- ProtoEnumAccounts(&accCount, &accList);
+ Proto_EnumAccounts(&accCount, &accList);
int protoCount;
PROTOCOLDESCRIPTOR **protoList;
- CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&protoList);
+ Proto_EnumProtocols(&protoCount, &protoList);
int protoCountMy = 0;
char** protoListMy = (char**)alloca((protoCount + accCount) * sizeof(char*));
@@ -333,7 +333,7 @@ static void GetProtocolStrings(CMString& buffer) for (i = 0; i < protoCountMy; i++)
if (!mir_strcmp(protoListMy[i], accList[j]->szProtoName)) {
protos[i].nloaded = accList[j]->bDynDisabled != 0;
- if (IsAccountEnabled(accList[j]))
+ if (Proto_IsAccountEnabled(accList[j]))
++protos[i].countse;
else
++protos[i].countsd;
diff --git a/plugins/CryptoPP/src/commonheaders.h b/plugins/CryptoPP/src/commonheaders.h index b5b5a9bb19..3da70a4494 100644 --- a/plugins/CryptoPP/src/commonheaders.h +++ b/plugins/CryptoPP/src/commonheaders.h @@ -36,7 +36,6 @@ #include <m_system.h>
#include <m_utils.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_utils.h>
#include <m_netlib.h>
diff --git a/plugins/CryptoPP/src/main.cpp b/plugins/CryptoPP/src/main.cpp index 8cb9bfa2b9..ebd54b4e21 100644 --- a/plugins/CryptoPP/src/main.cpp +++ b/plugins/CryptoPP/src/main.cpp @@ -57,7 +57,7 @@ extern "C" __declspec(dllexport) int Load() pd.cbSize = sizeof(pd);
pd.szName = (char*)szModuleName;
pd.type = PROTOTYPE_ENCRYPTION;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// hook events
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
diff --git a/plugins/CyrTranslit/src/TransliterationProtocol.cpp b/plugins/CyrTranslit/src/TransliterationProtocol.cpp index 27940f86ac..52eb90b6ef 100644 --- a/plugins/CyrTranslit/src/TransliterationProtocol.cpp +++ b/plugins/CyrTranslit/src/TransliterationProtocol.cpp @@ -32,7 +32,7 @@ void TransliterationProtocol::initialize() pd.cbSize = sizeof(pd);
pd.szName = MODULE_NAME;
pd.type = PROTOTYPE_TRANSLATION;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(MODULE_NAME, PSS_MESSAGE, sendMessage);
}
@@ -62,14 +62,14 @@ INT_PTR TransliterationProtocol::sendMessage(WPARAM wParam, LPARAM lParam) {
CCSDATA *ccs = reinterpret_cast<CCSDATA*>(lParam);
if ( !MirandaContact::bIsActive(ccs->hContact))
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
LPARAM oldlParam = ccs->lParam;
bool msgProcessed = true;
TranslateMessageUTF(wParam, lParam);
- int ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ int ret = Proto_ChainSend(wParam, ccs);
if (msgProcessed) {
mir_free(reinterpret_cast<void*>(ccs->lParam));
diff --git a/plugins/CyrTranslit/src/stdafx.h b/plugins/CyrTranslit/src/stdafx.h index 40f1692b52..ff94bd9471 100644 --- a/plugins/CyrTranslit/src/stdafx.h +++ b/plugins/CyrTranslit/src/stdafx.h @@ -22,7 +22,7 @@ #include <newpluginapi.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_clist.h>
#include <m_langpack.h>
diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp index e29a84d89d..4bcd1cfc90 100644 --- a/plugins/DbEditorPP/src/icons.cpp +++ b/plugins/DbEditorPP/src/icons.cpp @@ -75,7 +75,7 @@ HIMAGELIST LoadIcons() for(int i = 0; i < SIZEOF(dbeIcons); i++)
ImageList_AddIcon(hil, LoadSkinnedDBEIcon(dbeIcons[i]));
- ProtoEnumAccounts(&protoCount, &protocols);
+ Proto_EnumAccounts(&protoCount, &protocols);
for (int i = 0; i < protoCount; i++) {
if (!Proto_IsProtocolLoaded(protocols[i]->szModuleName))
diff --git a/plugins/DbEditorPP/src/stdafx.h b/plugins/DbEditorPP/src/stdafx.h index d1827fb6c1..8c5cf8eaa8 100644 --- a/plugins/DbEditorPP/src/stdafx.h +++ b/plugins/DbEditorPP/src/stdafx.h @@ -24,7 +24,6 @@ #include <m_clui.h>
#include <m_skin.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_database.h>
#include <m_db_int.h>
#include <m_system.h>
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp index 50be4b39cd..02894645a2 100644 --- a/plugins/Dropbox/src/dropbox.cpp +++ b/plugins/Dropbox/src/dropbox.cpp @@ -6,7 +6,7 @@ CDropbox::CDropbox() : transfers(1, HandleKeySortT) pd.cbSize = sizeof(pd);
pd.szName = MODULE;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
HookEvent(ME_PROTO_ACK, OnProtoAck);
HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
@@ -43,7 +43,7 @@ MCONTACT CDropbox::GetDefaultContact() if (!hDefaultContact)
{
hDefaultContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- if (!CallService(MS_PROTO_ADDTOCONTACT, hDefaultContact, (LPARAM)MODULE))
+ if (!Proto_AddToContact(hDefaultContact, MODULE))
{
db_set_s(NULL, MODULE, "Nick", MODULE);
db_set_s(hDefaultContact, MODULE, "Nick", MODULE);
diff --git a/plugins/Dropbox/src/stdafx.h b/plugins/Dropbox/src/stdafx.h index 3df9e83ad8..cf14580de3 100644 --- a/plugins/Dropbox/src/stdafx.h +++ b/plugins/Dropbox/src/stdafx.h @@ -26,7 +26,6 @@ #include <m_gui.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_dropbox.h>
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index fa6e4ddb6e..6892863329 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -116,17 +116,17 @@ INT_PTR OnSendFile(WPARAM wParam, LPARAM lParam) INT_PTR OnRecvMessage(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *pccsd = (CCSDATA *)lParam;
- PROTORECVEVENT *ppre = (PROTORECVEVENT *)pccsd->lParam;
+ CCSDATA *ccs = (CCSDATA *)lParam;
+ PROTORECVEVENT *ppre = (PROTORECVEVENT *)ccs->lParam;
if (strncmp(ppre->szMessage, szServicePrefix, mir_strlen(szServicePrefix)))
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
- HWND hwnd = WindowList_Find(hFileList, pccsd->hContact);
+ HWND hwnd = WindowList_Find(hFileList, ccs->hContact);
if (!IsWindow(hwnd))
{
if (hwnd != 0) WindowList_Remove(hFileList, hwnd);
- FILEECHO *fe = new FILEECHO(pccsd->hContact);
+ FILEECHO *fe = new FILEECHO(ccs->hContact);
fe->inSend = FALSE;
hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, DialogProc, (LPARAM)fe);
if (hwnd == NULL)
@@ -136,7 +136,7 @@ INT_PTR OnRecvMessage(WPARAM wParam, LPARAM lParam) }
}
char *msg = mir_strdup(ppre->szMessage + mir_strlen(szServicePrefix));
- PostMessage(hwnd, WM_FE_MESSAGE, (WPARAM)pccsd->hContact, (LPARAM)msg);
+ PostMessage(hwnd, WM_FE_MESSAGE, (WPARAM)ccs->hContact, (LPARAM)msg);
return 0;
}
@@ -203,7 +203,7 @@ extern "C" __declspec(dllexport) int Load(void) pd.cbSize = sizeof(pd);
pd.szName = SERVICE_NAME;
pd.type = PROTOTYPE_FILTER;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/plugins/FileAsMessage/src/main.h b/plugins/FileAsMessage/src/main.h index ee3577a12d..1063fb8668 100644 --- a/plugins/FileAsMessage/src/main.h +++ b/plugins/FileAsMessage/src/main.h @@ -8,7 +8,7 @@ #include <newpluginapi.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_clist.h>
#include <m_options.h>
diff --git a/plugins/GmailNotifier/src/gmail.h b/plugins/GmailNotifier/src/gmail.h index 9337667f7c..1c56a13e80 100644 --- a/plugins/GmailNotifier/src/gmail.h +++ b/plugins/GmailNotifier/src/gmail.h @@ -11,7 +11,6 @@ #include "m_clui.h"
#include "m_skin.h"
#include "m_langpack.h"
-#include "m_protomod.h"
#include "m_database.h"
#include "m_system.h"
#include "m_protocols.h"
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index 82ebf9e18a..784b4db6ab 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -95,7 +95,7 @@ extern "C" int __declspec(dllexport) Load() PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = pluginName;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(pluginName, PS_GETCAPS, GetCaps);
CreateProtoServiceFunction(pluginName, PS_GETSTATUS, GetStatus);
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index fff4b59f0e..19ce5830ac 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -150,7 +150,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetDlgItemTextA(hwndDlg, IDC_PASS, "");
SetFocus(hwndCombo);
acc[curIndex].hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)acc[curIndex].hContact, (LPARAM)pluginName);
+ Proto_AddToContact(acc[curIndex].hContact, pluginName);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index ca12e3596a..ccaaba045d 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -376,7 +376,7 @@ begin exit;
end;
- szProto := pAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0));
+ szProto := Proto_GetProtoName(wParam);
if (StrComp(cws.szModule, 'CList') <> 0) and
((szProto = nil) or (StrComp(cws.szModule, szProto) <> 0)) then
exit;
diff --git a/plugins/HistoryPlusPlus/hpp_contacts.pas b/plugins/HistoryPlusPlus/hpp_contacts.pas index e2a68e7ac3..fa8b9f6a4e 100644 --- a/plugins/HistoryPlusPlus/hpp_contacts.pas +++ b/plugins/HistoryPlusPlus/hpp_contacts.pas @@ -68,16 +68,16 @@ uses hpp_database, hpp_options; function GetContactProto(hContact: TMCONTACT): AnsiString;
begin
- Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ Result := Proto_GetProtoName(hContact);
end;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: AnsiString): AnsiString;
begin
- Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ Result := Proto_GetProtoName(hContact);
if (Result = META_PROTO) then
begin
SubContact := CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
- SubProtocol := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, SubContact, 0));
+ SubProtocol := Proto_GetProtoName(SubContact);
end
else
begin
diff --git a/plugins/HistoryStats/src/dlgoption_subglobal.cpp b/plugins/HistoryStats/src/dlgoption_subglobal.cpp index 9df4998661..27d8071290 100644 --- a/plugins/HistoryStats/src/dlgoption_subglobal.cpp +++ b/plugins/HistoryStats/src/dlgoption_subglobal.cpp @@ -241,16 +241,14 @@ void DlgOption::SubGlobal::onWMInitDialog() PROTOACCOUNT **protoList;
int protoCount;
-
- if (mu::proto::enumProtocols(&protoCount, &protoList) == 0) {
- upto_each_(i, protoCount)
- {
- m_hHideContactMenuProtos.push_back(m_Options.insertCheck(
- m_hProtocols,
- Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
- 0,
- reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
- }
+ Proto_EnumAccounts(&protoCount, &protoList);
+ upto_each_(i, protoCount)
+ {
+ m_hHideContactMenuProtos.push_back(m_Options.insertCheck(
+ m_hProtocols,
+ Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
+ 0,
+ reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
}
m_Options.ensureVisible(NULL);
diff --git a/plugins/HistoryStats/src/dlgoption_subinput.cpp b/plugins/HistoryStats/src/dlgoption_subinput.cpp index 68a3a9d2e9..90b9ff8e66 100644 --- a/plugins/HistoryStats/src/dlgoption_subinput.cpp +++ b/plugins/HistoryStats/src/dlgoption_subinput.cpp @@ -103,16 +103,14 @@ void DlgOption::SubInput::onWMInitDialog() PROTOACCOUNT **protoList;
int protoCount;
-
- if (mu::proto::enumProtocols(&protoCount, &protoList) == 0) {
- upto_each_(i, protoCount)
- {
- m_hProtosIgnore.push_back(m_Options.insertCheck(
- m_hProtocols,
- Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
- 0,
- reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
- }
+ Proto_EnumAccounts(&protoCount, &protoList);
+ upto_each_(i, protoCount)
+ {
+ m_hProtosIgnore.push_back(m_Options.insertCheck(
+ m_hProtocols,
+ Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
+ 0,
+ reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
}
// diable filtering raw RTF if 'rtfconv.dll' isn't available
diff --git a/plugins/HistoryStats/src/mirandahistory.cpp b/plugins/HistoryStats/src/mirandahistory.cpp index 498e414d8d..8d703015e2 100644 --- a/plugins/HistoryStats/src/mirandahistory.cpp +++ b/plugins/HistoryStats/src/mirandahistory.cpp @@ -13,16 +13,14 @@ void MirandaHistory::populateProtocols() PROTOACCOUNT **protoList;
int protoCount;
+ Proto_EnumAccounts(&protoCount, &protoList);
+ upto_each_(i, protoCount)
+ {
+ ext::a::string protoName = protoList[i]->szModuleName;
- if (mu::proto::enumProtocols(&protoCount, &protoList) == 0) {
- upto_each_(i, protoCount)
- {
- ext::a::string protoName = protoList[i]->szModuleName;
-
- Protocol& curProto = m_Protocols[protoName];
+ Protocol& curProto = m_Protocols[protoName];
- curProto.displayName = Protocol::getDisplayName(protoName);
- }
+ curProto.displayName = Protocol::getDisplayName(protoName);
}
m_DefaultProtocol.displayName = TranslateT("(Unknown)");
diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 4587d81ff8..971a525ae3 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -179,23 +179,6 @@ namespace mu }
/*
- * proto
- */
-
- namespace proto
- {
- int enumProtocols(int* numProtocols, PROTOACCOUNT*** ppProtoDescriptors)
- {
- return ProtoEnumAccounts(numProtocols, ppProtoDescriptors);
- }
-
- const char* getContactBaseProto(MCONTACT hContact)
- {
- return reinterpret_cast<const char*>(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
- }
- }
-
- /*
* protosvc
*/
diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h index c249659a1a..6786201805 100644 --- a/plugins/HistoryStats/src/mu_common.h +++ b/plugins/HistoryStats/src/mu_common.h @@ -72,16 +72,6 @@ namespace mu }
/*
- * proto
- */
-
- namespace proto
- {
- int enumProtocols(int* numProtocols, PROTOACCOUNT*** ppProtoDescriptors);
- const char* getContactBaseProto(MCONTACT hContact);
- }
-
- /*
* protosvc
*/
diff --git a/plugins/HistoryStats/src/protocol.cpp b/plugins/HistoryStats/src/protocol.cpp index 8914310740..16374745d3 100644 --- a/plugins/HistoryStats/src/protocol.cpp +++ b/plugins/HistoryStats/src/protocol.cpp @@ -5,6 +5,6 @@ ext::string Protocol::getDisplayName(const ext::a::string& protocol)
{
- PROTOACCOUNT *pa = ProtoGetAccount(protocol.c_str());
+ PROTOACCOUNT *pa = Proto_GetAccount(protocol.c_str());
return (pa == NULL) ? utils::fromA(protocol) : pa->tszAccountName;
}
diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h index 76b7afa97b..0b8e3d16c6 100644 --- a/plugins/HistoryStats/src/stdafx.h +++ b/plugins/HistoryStats/src/stdafx.h @@ -58,7 +58,6 @@ #include <m_options.h>
#include <m_popup.h> // not used
#include <m_protocols.h>
-#include <m_protomod.h> // not used
#include <m_protosvc.h>
#include <m_skin.h>
#include <m_system.h>
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 65cf519515..16c7e3e020 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -1477,7 +1477,7 @@ void Options::init() int protoCount;
PROTOACCOUNT **pProtos;
ProtocolSettings *lastProto = NULL;
- ProtoEnumAccounts(&protoCount, &pProtos);
+ Proto_EnumAccounts(&protoCount, &pProtos);
for (int i = 0; i < protoCount + 1; i++) {
ProtocolSettings *proto;
char tmpPath[MAX_PATH];
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index e31a16a8b9..88aadd22ea 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -166,7 +166,7 @@ static MCONTACT HistoryImportFindContact(HWND hdlgProgress, char *szModuleName, return INVALID_CONTACT_ID;
hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)szModuleName);
+ Proto_AddToContact(hContact, szModuleName);
db_set_dw(hContact, szModuleName, "UIN", uin);
AddMessage(LPGENT("Added contact %u (found in history)"), uin);
return hContact;
@@ -275,7 +275,7 @@ static LRESULT CALLBACK ListWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM int protoCount, iSel = 0;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
for (int i = 0; i < protoCount; i++) {
int idx = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
SendMessage(hwndCombo, CB_SETITEMDATA, idx, (LPARAM)accs[i]);
@@ -394,7 +394,7 @@ static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto, {
int destProtoCount;
PROTOACCOUNT **destAccs;
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&destProtoCount, (LPARAM)&destAccs);
+ Proto_EnumAccounts(&destProtoCount, &destAccs);
PROTOACCOUNT *pProto = NULL;
for (int i = 0; i < destProtoCount; i++) {
@@ -548,7 +548,7 @@ static MCONTACT MapContact(MCONTACT hSrc) static MCONTACT AddContact(HWND hdlgProgress, char* szProto, char* pszUniqueSetting, DBVARIANT* id, const TCHAR* pszUserID, TCHAR *nick, TCHAR *group)
{
MCONTACT hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)szProto) != 0) {
+ if (Proto_AddToContact(hContact, szProto) != 0) {
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
AddMessage(LPGENT("Failed to add %S contact %s"), szProto, pszUserID);
return INVALID_CONTACT_ID;
@@ -719,7 +719,7 @@ void ImportMeta(DBCachedContact *ccSrc) // do we need to add a new metacontact?
if (hDest == INVALID_CONTACT_ID) {
hDest = CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hDest, LPARAM(META_PROTO));
+ Proto_AddToContact(hDest, META_PROTO);
CopySettings(ccSrc->contactID, META_PROTO, hDest, META_PROTO);
ccDst = dstDb->m_cache->GetCachedContact(hDest);
@@ -768,7 +768,7 @@ void ImportMeta(DBCachedContact *ccSrc) else AddMessage(LPGENT("Added metacontact"));
}
- PROTOACCOUNT *pa = ProtoGetAccount(META_PROTO);
+ PROTOACCOUNT *pa = Proto_GetAccount(META_PROTO);
if (pa) {
AccountMap pda(META_PROTO, 0, _T(META_PROTO));
ImportContactSettings(&pda, ccSrc->contactID, ccDst->contactID);
@@ -799,7 +799,7 @@ static MCONTACT ImportContact(MCONTACT hSrc) return NULL;
}
- if (!ProtoGetAccount(pda->pa->szModuleName)) {
+ if (!Proto_GetAccount(pda->pa->szModuleName)) {
AddMessage(LPGENT("Skipping contact, %S not installed."), cc->szProto);
return NULL;
}
@@ -1114,7 +1114,7 @@ void MirandaImport(HWND hdlg) int protoCount;
PROTOACCOUNT **accs;
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&protoCount, (LPARAM)&accs);
+ Proto_EnumAccounts(&protoCount, &accs);
if (protoCount > 0)
ImportHistory(NULL, accs, protoCount);
diff --git a/plugins/Import/src/import.h b/plugins/Import/src/import.h index 572ac475f2..4e412862cb 100644 --- a/plugins/Import/src/import.h +++ b/plugins/Import/src/import.h @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h>
#include <m_system_cpp.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_icolib.h>
#include <m_clist.h>
#include <m_db_int.h>
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index 04f1bc2ff2..55e85c3266 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -88,7 +88,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) // Only autorun import wizard if at least one protocol is installed
int nProtocols = 0;
PROTOACCOUNT **ppProtos = NULL;
- ProtoEnumAccounts(&nProtocols, &ppProtos);
+ Proto_EnumAccounts(&nProtocols, &ppProtos);
if (nProtocols > 0) {
CallService(IMPORT_SERVICE, 0, 0);
db_set_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 1);
diff --git a/plugins/ImportTXT/General.pas b/plugins/ImportTXT/General.pas index a27c64728a..e6bac9318b 100644 --- a/plugins/ImportTXT/General.pas +++ b/plugins/ImportTXT/General.pas @@ -269,7 +269,7 @@ begin Contact := db_find_first();
while (Contact <> 0) do
begin
- otherproto := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, Contact, 0));
+ otherproto := Proto_GetProtoName(Contact);
if otherproto = proto then
begin
ci.cbSize := SizeOf(ci);
@@ -304,7 +304,7 @@ begin Contact := db_find_first();
while (Contact <> 0) do
begin
- otherproto := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, Contact, 0));
+ otherproto := Proto_GetProtoName(Contact);
if otherproto = proto then
begin
ci.cbSize := SizeOf(ci);
@@ -333,7 +333,7 @@ var begin
ProtoCount := 0;
SetLength(Protocols, 30);
- CallService(MS_PROTO_ENUMACCOUNTS, int(@iProtoCount), int(@ppAccounts));
+ Proto_EnumAccounts(iProtoCount, ppAccounts);
for i := 1 to iProtoCount do
begin
temps := GetContactID(0, ppAccounts^^.szModuleName, false);
@@ -351,7 +351,7 @@ end; function GetContactProto(hContact: THandle): AnsiString;
begin
- result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ result := Proto_GetProtoName(hContact);
end;
function DBFreeVariant(dbv: PDBVARIANT): integer;
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 61e9a6b01d..d3d18ab646 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -652,7 +652,7 @@ void updateXstatusProto(PROTOCOL_INFO *protoInfo) void createProtocolList(void) { PROTOACCOUNT **proto; - ProtoEnumAccounts(&ProtoList.protoCount, &proto); + Proto_EnumAccounts(&ProtoList.protoCount, &proto); ProtoList.protoInfo = (PROTOCOL_INFO *)malloc(ProtoList.protoCount * sizeof(PROTOCOL_INFO)); if (!ProtoList.protoInfo) { ProtoList.protoCount = 0; diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index bacf145aa4..a0b31b6e55 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -225,7 +225,7 @@ INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR lvItem.iSubItem = 0; for (int i=0; i < ProtoList.protoCount; i++) { int count; PROTOACCOUNT** protos; - ProtoEnumAccounts( &count, &protos ); + Proto_EnumAccounts( &count, &protos ); if(ProtoList.protoInfo[i].visible) { lvItem.lParam = (LPARAM)ProtoList.protoInfo[i].szProto; lvItem.pszText = protos[i] -> tszAccountName; @@ -1362,7 +1362,7 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (ProtoList.protoInfo[i].enabled && XstatusListAux[i].count) { int count; PROTOACCOUNT **protos; - ProtoEnumAccounts( &count, &protos ); + Proto_EnumAccounts( &count, &protos ); tvis.hParent = NULL; tvis.hInsertAfter = TVI_LAST; diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 27f038b856..b28d5d8670 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -327,7 +327,7 @@ int ModulesLoaded(WPARAM, LPARAM) // Add each proto
PROTOACCOUNT **protos;
int count;
- ProtoEnumAccounts(&count,&protos);
+ Proto_EnumAccounts(&count,&protos);
for (int i = 0; i < count; i++)
if (protos[i]->bIsEnabled)
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index b8911e0a6a..decd4e0a18 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -1759,7 +1759,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.cbSize = sizeof(pd);
pd.szName = PLUGINNAME;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
//set all contacts to offline ///TODO: are that contacts exists ?
for(MCONTACT hContact = db_find_first(PLUGINNAME); hContact; hContact = db_find_next(hContact, PLUGINNAME)){
diff --git a/plugins/LotusNotify/src/stdafx.h b/plugins/LotusNotify/src/stdafx.h index c61bdbf3e8..0cf1942427 100644 --- a/plugins/LotusNotify/src/stdafx.h +++ b/plugins/LotusNotify/src/stdafx.h @@ -20,7 +20,6 @@ #include <m_options.h>
#include <m_popup.h>
#include <m_utils.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_system.h>
//debug.h
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 5a4a1b3fff..895f5d0f1d 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -599,7 +599,7 @@ INT_PTR onCopyID(WPARAM wparam, LPARAM lparam) GetID(hContact, szProto, (LPSTR)&szID, SIZEOF(szID));
if (db_get_dw(NULL, MODULENAME, "flags", vf_default) & VF_CIDN) {
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (!pa->bOldProto)
mir_snprintf(buffer, "%s: %s", pa->szProtoName, szID);
@@ -700,13 +700,13 @@ INT_PTR onChangeProto(WPARAM wparam, LPARAM lparam) if (CTRL_IS_PRESSED) {
hContactNew = hContact;
RenameDbProto(hContact, hContactNew, GetContactProto(hContact), (char*)lparam, 1);
- CallService(MS_PROTO_REMOVEFROMCONTACT, hContact, (LPARAM)GetContactProto(hContact));
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContactNew, lparam);
+ Proto_RemoveFromContact(hContact, GetContactProto(hContact));
+ Proto_AddToContact(hContactNew, (char*)lparam);
}
else {
hContactNew = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContactNew) {
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContactNew, lparam);
+ Proto_AddToContact(hContactNew, (char*)lparam);
RenameDbProto(hContact, hContactNew, GetContactProto(hContact), (char*)lparam, 0);
RenameDbProto(hContact, hContactNew, "CList", "CList", 0);
}
@@ -776,7 +776,7 @@ int BuildMenu(WPARAM wparam, LPARAM) BOOL bIsOnline = FALSE, bShowAll = CTRL_IS_PRESSED;
MCONTACT hContact = (MCONTACT)wparam;
char* pszProto = GetContactProto(hContact);
- PROTOACCOUNT *pa = ProtoGetAccount(pszProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(pszProto);
bIsOnline = isProtoOnline(pszProto);
@@ -822,15 +822,15 @@ int BuildMenu(WPARAM wparam, LPARAM) j++;
}
- int check = 0 != CallService(MS_PROTO_ISPROTOONCONTACT, wparam, (LPARAM)accs[i]->szModuleName);
+ int check = Proto_IsProtoOnContact(wparam, accs[i]->szModuleName);
ModifySubmenuItem(hProtoItem[i], accs[i]->tszAccountName, check, hide);
}
Menu_ShowItem(hmenuProto, j > 1);
}
else Menu_ShowItem(hmenuProto, false);
- Menu_ShowItem(hmenuAdded, (bShowAll || (flags & VF_ADD)) && bIsOnline && IsAccountEnabled(pa));
- Menu_ShowItem(hmenuAuthReq, (bShowAll || (flags & VF_REQ)) && bIsOnline && IsAccountEnabled(pa));
+ Menu_ShowItem(hmenuAdded, (bShowAll || (flags & VF_ADD)) && bIsOnline && Proto_IsAccountEnabled(pa));
+ Menu_ShowItem(hmenuAuthReq, (bShowAll || (flags & VF_REQ)) && bIsOnline && Proto_IsAccountEnabled(pa));
bEnabled = bShowAll || (flags & VF_CID);
Menu_ShowItem(hmenuCopyID, bEnabled);
@@ -883,7 +883,7 @@ int EnumProtoSubmenu(WPARAM, LPARAM) }
}
}
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
if (protoCount > MAX_PROTOS)
protoCount = MAX_PROTOS;
for (int i = 0; i < protoCount; i++)
diff --git a/plugins/MenuItemEx/src/menuex.h b/plugins/MenuItemEx/src/menuex.h index 51539bdf50..1d3ae7cda6 100644 --- a/plugins/MenuItemEx/src/menuex.h +++ b/plugins/MenuItemEx/src/menuex.h @@ -10,9 +10,9 @@ #include <m_system_cpp.h>
#include <m_options.h>
#include <m_database.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_file.h>
-#include <m_protomod.h>
#include <m_clui.h>
#include <m_ignore.h>
#include <m_icolib.h>
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index 8feae7a960..b213b3d1c9 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -481,9 +481,9 @@ void MirandaUtils::translateOldDBNames() { //account's settings "ACCOUNTSTATE_"
int accountsTmpCount = 0;
PROTOACCOUNT **accountsTmp;
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&accountsTmpCount, (LPARAM)&accountsTmp);
- for(int i=0; i<accountsTmpCount; i++) {
+ Proto_EnumAccounts(&accountsTmpCount, &accountsTmp);
+ for(int i=0; i<accountsTmpCount; i++) {
logger->log_p(L"TranslateOldDBNames: found ACCOUNT: [%s] protocol: [%S]", accountsTmp[i]->tszAccountName, accountsTmp[i]->szProtoName);
std::string mirandaAccountDBKey("ACCOUNTSTATE_");
@@ -496,7 +496,7 @@ void MirandaUtils::translateOldDBNames() { }
}
- //contacts "state"
+ //contacts "state"
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)){
logger->log_p(L"TranslateOldDBNames: found CONTACT: [" SCNuPTR L"]", hContact);
diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp index 9ed2657ee9..17d5a782ab 100644 --- a/plugins/MirFox/src/MirfoxData.cpp +++ b/plugins/MirFox/src/MirfoxData.cpp @@ -280,14 +280,12 @@ MirfoxData::getContactDefaultState(MirandaContact* contact) void
MirfoxData::initializeMirandaAccounts()
{
-
clearMirandaAccounts();
+ //get accounts from Miranda by CallService MS_PROTO_ENUMACCOUNTS
int accountsCount = 0;
PROTOACCOUNT **accounts;
-
- //get accounts from Miranda by CallService MS_PROTO_ENUMACCOUNTS
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&accountsCount, (LPARAM)&accounts);
+ Proto_EnumAccounts(&accountsCount, &accounts);
uint64_t protocolId = 1;
@@ -372,12 +370,11 @@ void MirfoxData::initializeMirandaContacts() for (mirandaContactsIter = mirandaContactsPtr->begin(); mirandaContactsIter != mirandaContactsPtr->end(); mirandaContactsIter++){
logger->log_p(L"initializeMirandaContacts: try to get account for hContact = [" SCNuPTR L"]", mirandaContactsIter->contactHandle);
- char* szModuleName = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, (WPARAM)(mirandaContactsIter->contactHandle), 0);
- if (szModuleName == NULL){
+ char *szModuleName = Proto_GetBaseAccountName(mirandaContactsIter->contactHandle);
+ if (szModuleName == NULL)
continue; //mirandaContactsIter->mirandaAccountPtr will be NULL
- }
- mirandaContactsIter->mirandaAccountPtr = getMirandaAccountPtrBySzModuleName(szModuleName);
+ mirandaContactsIter->mirandaAccountPtr = getMirandaAccountPtrBySzModuleName(szModuleName);
}
diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp index bfdfd10f07..1f349a4c22 100644 --- a/plugins/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/src/dbfilter.cpp @@ -178,7 +178,7 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) if ((hTemp = db_mc_getMostOnline(hContact)) != 0) hContact = hTemp; - if (!CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)MODULENAME)) + if (!Proto_IsProtoOnContact(hContact, MODULENAME)) return 0; lib_cs_lock(); @@ -243,7 +243,7 @@ int OnContactSettingChanged(WPARAM hContact, LPARAM lParam) StatusModeChange((WPARAM)ID_STATUS_OFFLINE, (LPARAM)cws->szModule); return 0; } - if (CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)MODULENAME)) { + if (Proto_IsProtoOnContact(hContact, MODULENAME)) { // only care about contacts to which this filter is attached FinishSession(hContact); } diff --git a/plugins/MirOTR/src/dllmain.cpp b/plugins/MirOTR/src/dllmain.cpp index b798ccefc3..d961050b49 100644 --- a/plugins/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/src/dllmain.cpp @@ -79,12 +79,12 @@ extern "C" __declspec(dllexport) int Load(void) pd.cbSize = sizeof(pd);
pd.szName = MODULENAME; pd.type = PROTOTYPE_ENCRYPTION; - CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd); + Proto_RegisterModule(&pd); // remove us as a filter to all contacts - fix filter type problem if(db_get_b(0, MODULENAME, "FilterOrderFix", 0) != 2) { for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) - CallService(MS_PROTO_REMOVEFROMCONTACT, hContact, (LPARAM)MODULENAME); + Proto_RemoveFromContact(hContact, MODULENAME); db_set_b(0, MODULENAME, "FilterOrderFix", 2); } diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 697b0ba1c3..5178e6cf25 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -319,7 +319,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP int num_protocols; PROTOACCOUNT **pppDesc; - ProtoEnumAccounts(&num_protocols, &pppDesc); + Proto_EnumAccounts(&num_protocols, &pppDesc); for (int i = 0; i < num_protocols; i++) { if (!mir_strcmp(pppDesc[i]->szModuleName, META_PROTO)) continue; @@ -502,7 +502,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { const char *proto = GetContactProto(hContact); - if (proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)MODULENAME) // ignore chatrooms + if (proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && Proto_IsProtoOnContact(hContact, MODULENAME) // ignore chatrooms && mir_strcmp(proto, META_PROTO) != 0) // and MetaContacts { lvI.iItem = 0; @@ -511,7 +511,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvI.pszText = (TCHAR*)contact_get_nameT(hContact); lvI.iItem = ListView_InsertItem(lv, &lvI); - PROTOACCOUNT *pa = ProtoGetAccount(proto); + PROTOACCOUNT *pa = Proto_GetAccount(proto); ListView_SetItemText(lv, lvI.iItem, 1, pa->tszAccountName); ListView_SetItemText(lv, lvI.iItem, 2, (TCHAR*)policy_to_string((OtrlPolicy)db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY))); @@ -683,7 +683,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w if (context->app_data) { user = (TCHAR*)contact_get_nameT((MCONTACT)context->app_data); if (user) { - PROTOACCOUNT *pa = ProtoGetAccount(context->protocol); + PROTOACCOUNT *pa = Proto_GetAccount(context->protocol); for (Fingerprint *fp = context->fingerprint_root.next; fp; fp = fp->next) { otrl_privkey_hash_to_humanT(hash, fp->fingerprint); @@ -749,7 +749,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w MCONTACT hContact = (MCONTACT)fp->context->app_data; TCHAR buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, fp->fingerprint); - PROTOACCOUNT *pa = ProtoGetAccount(GetContactProto(hContact)); + PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); mir_sntprintf(buff, SIZEOF(buff) - 1, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); buff[SIZEOF(buff) - 1] = '\0'; ShowError(buff); @@ -780,7 +780,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w MCONTACT hContact = (MCONTACT)it->first->context->app_data; TCHAR buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, it->first->fingerprint); - PROTOACCOUNT *pa = ProtoGetAccount(GetContactProto(hContact)); + PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); mir_sntprintf(buff, SIZEOF(buff) - 1, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); buff[SIZEOF(buff) - 1] = '\0'; ShowError(buff); diff --git a/plugins/MirOTR/src/stdafx.h b/plugins/MirOTR/src/stdafx.h index ce52cb5ff7..450ebdc342 100644 --- a/plugins/MirOTR/src/stdafx.h +++ b/plugins/MirOTR/src/stdafx.h @@ -27,8 +27,8 @@ using namespace std; #include <m_langpack.h> #include <m_database.h> #include <m_message.h> -#include <m_protomod.h> #include <m_popup.h> +#include <m_protosvc.h> #include <m_contacts.h> #include <m_icolib.h> #include <m_skin.h> diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp index 81a78e3005..f6edc8e7e7 100644 --- a/plugins/MirOTR/src/svcs_proto.cpp +++ b/plugins/MirOTR/src/svcs_proto.cpp @@ -11,11 +11,11 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ DEBUGOUTA("'\n"); if (ccs->wParam & PREF_BYPASS_OTR) // bypass for OTR-messages - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + return Proto_ChainSend(wParam, ccs); char *proto = GetContactProto(ccs->hContact); if(proto && mir_strcmp(proto, META_PROTO) == 0) // bypass for metacontacts - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + return Proto_ChainSend(wParam, ccs); if (!proto || !ccs->hContact) return 1; // error @@ -27,7 +27,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ // don't filter OTR messages being sent (OTR messages should only happen *after* the otrl_message_sending call below) if(strncmp(oldmessage, "?OTR", 4) == 0) { DEBUGOUT_T("OTR message without PREF_BYPASS_OTR\n"); - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + return Proto_ChainSend(wParam, ccs); } ptrA tmpencode; @@ -51,7 +51,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ } if (newmessage == NULL) - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + return Proto_ChainSend(wParam, ccs); if(!newmessage[0]){ otrl_message_free(newmessage); @@ -60,7 +60,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ WPARAM oldflags = ccs->wParam; ccs->lParam = (LPARAM)newmessage; - INT_PTR ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam); + INT_PTR ret = Proto_ChainSend(wParam, ccs); DEBUGOUTA("OTR - sending raw message: '"); DEBUGOUTA((const char*)ccs->lParam); @@ -82,15 +82,14 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) DEBUGOUTA(pre->szMessage); DEBUGOUTA("'\n"); - if (pre->flags & PREF_BYPASS_OTR) { // bypass for our inline messages - return CallService(MS_PROTO_CHAINRECV, wParam, lParam); - } + if (pre->flags & PREF_BYPASS_OTR) // bypass for our inline messages + return Proto_ChainRecv(wParam, ccs); char *proto = GetContactProto(ccs->hContact); if (!proto || !ccs->hContact) return 1; //error else if(proto && mir_strcmp(proto, META_PROTO) == 0) // bypass for metacontacts - return CallService(MS_PROTO_CHAINRECV, wParam, lParam); + return Proto_ChainRecv(wParam, ccs); char *oldmessage = pre->szMessage; // convert oldmessage to utf-8 @@ -124,7 +123,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) return 1; // discard internal protocol messages } if (newmessage == NULL) - return CallService(MS_PROTO_CHAINRECV, wParam, lParam); + return Proto_ChainRecv(wParam, ccs); DWORD oldflags = pre->flags; @@ -146,7 +145,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) msg_free = mir_free; } pre->szMessage = newmessage; - BOOL ret = CallService(MS_PROTO_CHAINRECV, wParam, lParam); + BOOL ret = Proto_ChainRecv(wParam, ccs); /// @todo (White-Tiger#1#03/23/15): why are we doing this? pre->flags = oldflags; pre->szMessage = oldmessage; diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 7dbfc0a293..0dfc5a2407 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -128,12 +128,6 @@ __inline const TCHAR* contact_get_nameT(MCONTACT hContact) { return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR); } - -__inline const char* contact_get_account(MCONTACT hContact) { - char *uacc = (char *)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0); - return uacc; -} - TCHAR* ProtoGetNickname(const char* proto) { CONTACTINFO ci = {sizeof(ci)}; diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index b31b5a76f5..f8ff7c95c4 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -87,7 +87,7 @@ bool CAppletManager::Initialize(tstring strAppletName) CProtocolData *pProtoData = NULL; CIRCConnection *pIRCConnection = NULL; - ProtoEnumAccounts(&iCount, &ppAccounts); + Proto_EnumAccounts(&iCount, &ppAccounts); for(int i=0;i<iCount;i++) { /**if(ppProtocolDescriptor[i]->type != PROTOTYPE_PROTOCOL) diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 64892272e5..6fe8307ecf 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -116,7 +116,7 @@ void CConfig::LoadSettings() CProtoFilter *pProtoFilter;
tstring strSetting;
- CallService(MS_PROTO_ENUMACCOUNTS,(WPARAM)&iCount,(LPARAM)&ppAccounts);
+ Proto_EnumAccounts(&iCount, &ppAccounts);
for(int i=0;i<iCount;i++)
{
/*if(ppProtocolDescriptor[i]->type != PROTOTYPE_PROTOCOL)
diff --git a/plugins/MirandaG15/src/StdAfx.h b/plugins/MirandaG15/src/StdAfx.h index 3c2e1eb790..f92f33606d 100644 --- a/plugins/MirandaG15/src/StdAfx.h +++ b/plugins/MirandaG15/src/StdAfx.h @@ -20,7 +20,6 @@ using namespace std; #include <newpluginapi.h>
#include <m_message.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_database.h>
#include <m_options.h>
diff --git a/plugins/ModernOpt/src/commonheaders.h b/plugins/ModernOpt/src/commonheaders.h index 51e6bc386c..1748b702f5 100644 --- a/plugins/ModernOpt/src/commonheaders.h +++ b/plugins/ModernOpt/src/commonheaders.h @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_utils.h>
#include <m_langpack.h>
#include <m_clistint.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_skin.h>
#include <m_userinfo.h>
#include <m_descbutton.h>
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 160d36df35..d458e782da 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1288,7 +1288,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa sItem.mask = LVIF_TEXT | LVIF_IMAGE;
char szTemp[500];
- ProtoEnumAccounts(&nCount, &proto);
+ Proto_EnumAccounts(&nCount, &proto);
for (int i = 0; i < nCount; i++)
{
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index b011740b6e..8f570a717b 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -27,7 +27,7 @@ void InitProtocolData() {
PROTOACCOUNT **protos;
int count;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
protocols = new ProtocolArray(count);
@@ -152,7 +152,7 @@ void Protocol::SetStatus(int aStatus) PROTOACCOUNT **accs;
pCount = 0;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (i = 0; i < count; i++) {
if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 5821da7ec3..90976f1d3c 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -215,7 +215,7 @@ int StatusChanged(WPARAM wParam, LPARAM lParam) else {
PROTOACCOUNT **accs;
int numAccs = 0;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++) {
Flag1 |= CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
Flag3 |= CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0);
@@ -583,7 +583,7 @@ int MirandaLoaded(WPARAM, LPARAM) int numAccs = 0;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0, CurProtoIndex = 0; i < numAccs && CurProtoIndex < MAXICQACCOUNTS; i++) {
HANDLE hHook = HookEvent(CString(accs[i]->szModuleName) + ME_ICQ_STATUSMSGREQ, StatusMsgReqHooks[CurProtoIndex]);
if (hHook) {
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 22ff666fe5..827bd0be7c 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -32,7 +32,7 @@ void __cdecl UpdateMsgsThreadProc(void *) {
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
while (WaitForSingleObject(g_hTerminateUpdateMsgsThread, 0) == WAIT_TIMEOUT && !Miranda_Terminated()) {
DWORD MinUpdateTimeDifference = g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_UPDATEMSGSPERIOD) * 1000; // in milliseconds
@@ -92,7 +92,7 @@ void ChangeProtoMessages(char* szProto, int iMode, TCString &Msg) else { // change message of all protocols
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++) {
PROTOACCOUNT *p = accs[i];
if (!db_get_b(NULL, p->szModuleName, "LockMainStatus", 0)) {
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index 55b1da1d22..c0dbd1dab7 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -261,7 +261,7 @@ public: if (!szProto) {
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++)
(*this)[accs[i]->szModuleName]; // add a protocol if it isn't in the list yet
}
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index be3d3093aa..a485cd6097 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -809,7 +809,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA WindowTitle += _T(")");
}
else {
- PROTOACCOUNT *acc = ProtoGetAccount(szProto);
+ PROTOACCOUNT *acc = Proto_GetAccount(szProto);
WindowTitle += acc->tszAccountName;
WindowTitle += _T(")");
}
@@ -872,12 +872,12 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA HTREEITEM hItem = hSelItem = CList->AddInfo(TranslateT("** All contacts **"), CLC_ROOT, CLC_ROOT, NULL, Skin_LoadProtoIcon(NULL, g_ProtoStates[(char*)NULL].Status));
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++) {
PROTOACCOUNT *p = accs[i];
// don't forget to change Recent Message Save loop in the UM_SAM_APPLYANDCLOSE if you're changing something here
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- PROTOACCOUNT * acc = ProtoGetAccount(p->szModuleName);
+ PROTOACCOUNT * acc = Proto_GetAccount(p->szModuleName);
hItem = CList->AddInfo(TCString(_T("* ")) + acc->tszAccountName + _T(" *"), CLC_ROOT, hItem, (LPARAM)p->szModuleName, Skin_LoadProtoIcon(p->szModuleName, g_ProtoStates[p->szModuleName].Status));
if (dat->szProtocol && !mir_strcmp(p->szModuleName, dat->szProtocol))
hSelItem = hItem;
@@ -928,7 +928,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA // save Recent Messages
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++) {
PROTOACCOUNT *p = accs[i];
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index dd3a5c2796..d8de67a965 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -1139,9 +1139,9 @@ int ModulesLoaded(WPARAM, LPARAM) int count = 0;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
for (int i = 0; i < count; i++)
- if (IsAccountEnabled(accounts[i]))
+ if (Proto_IsAccountEnabled(accounts[i]))
db_set_b(NULL, MODULE, accounts[i]->szModuleName, 0);
return 0;
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 7c4be90878..2fc03679d2 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -717,7 +717,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
if (IsSuitableProto(protos[i])) {
diff --git a/plugins/New_GPG/src/commonheaders.h b/plugins/New_GPG/src/commonheaders.h index 5af43c1c9e..6cc28e31b6 100644 --- a/plugins/New_GPG/src/commonheaders.h +++ b/plugins/New_GPG/src/commonheaders.h @@ -60,7 +60,6 @@ using std::fstream; #include <m_langpack.h> #include <m_clui.h> #include <m_skin.h> -#include <m_protomod.h> #include <m_jabber.h> #include <m_icq.h> #include <m_message.h> diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index bc786fa263..7e06f1040c 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -156,7 +156,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) pd.cbSize = sizeof(pd);
pd.szName = szGPGModuleName;
pd.type = PROTOTYPE_ENCRYPTION;
- CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(szGPGModuleName, PSR_MESSAGE, RecvMsgSvc);
CreateProtoServiceFunction(szGPGModuleName, PSS_MESSAGE, SendMsgSvc);
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index b07872ca9c..9275f0d0e2 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -213,7 +213,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR { //get accounts int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); std::wstring accs; for(int i = 0; i < count; i++) { @@ -252,7 +252,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR SendDlgItemMessageA(hwndDlg, IDC_ACCOUNT, CB_ADDSTRING, 0, (LPARAM)Translate("Default")); int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); for(int i = 0; i < count; i++) { if(StriStr(accounts[i]->szModuleName, "metacontacts")) @@ -2084,7 +2084,7 @@ void InitCheck() _wmkdir(tmp_dir.c_str()); int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); string question; //char *keyid = nullptr, *key = nullptr; char *keyid = nullptr; @@ -2242,7 +2242,7 @@ void InitCheck() { int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); ICQ_CUSTOMCAP cap; cap.cbSize = sizeof(ICQ_CUSTOMCAP); cap.hIcon = 0; @@ -2257,7 +2257,7 @@ void InitCheck() { int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); ICQ_CUSTOMCAP cap; cap.cbSize = sizeof(ICQ_CUSTOMCAP); cap.hIcon = 0; diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index 42f3db1978..2fe285c330 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -341,18 +341,18 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) { CCSDATA *ccs = (CCSDATA*)l; if (!ccs) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); PROTORECVEVENT *pre = (PROTORECVEVENT*)(ccs->lParam); if (!pre) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); char *msg = pre->szMessage; if (!msg) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); DWORD dbflags = DBEF_UTF; if(db_mc_isMeta(ccs->hContact)) { if(!strstr(msg, "-----BEGIN PGP MESSAGE-----")) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); else { if(bDebugLog) @@ -578,7 +578,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) } } if(!strstr(msg, "-----BEGIN PGP MESSAGE-----")) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); boost::thread *thr = new boost::thread(boost::bind(RecvMsgSvc_func, ccs->hContact, str, msg, (DWORD)ccs->wParam, pre->timestamp)); return 0; } @@ -758,21 +758,21 @@ INT_PTR SendMsgSvc(WPARAM w, LPARAM l) { CCSDATA *ccs = (CCSDATA*)l; if (!ccs) - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); if(!ccs->lParam) - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); char *msg = (char*)ccs->lParam; if (!msg) { if(bDebugLog) debuglog<<std::string(time_str()+": info: failed to get message data, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } if(strstr(msg,"-----BEGIN PGP MESSAGE-----")) { if(bDebugLog) debuglog<<std::string(time_str()+": info: encrypted messge, let it go, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } if(bDebugLog) debuglog<<std::string(time_str()+": info: contact have key, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); @@ -782,7 +782,7 @@ INT_PTR SendMsgSvc(WPARAM w, LPARAM l) { if(bDebugLog) debuglog<<std::string(time_str()+": info: contact not secured, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } return returnNoError(ccs->hContact); } diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index bef246278a..34728486b2 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -155,7 +155,7 @@ INT_PTR SendKey(WPARAM w, LPARAM l) std::string key_id_str; { LPSTR proto = GetContactProto(hContact); - PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)proto); + PROTOACCOUNT *acc = Proto_GetAccount(proto); std::string acc_str; if(acc) { @@ -240,7 +240,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l) { CLISTMENUITEM mi2 = { sizeof(mi2) }; LPSTR proto = GetContactProto(hContact); - PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)proto); + PROTOACCOUNT *acc = Proto_GetAccount(proto); std::string setting; if(acc) { @@ -531,9 +531,10 @@ std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename) //from secureim partially INT_PTR onSendFile(WPARAM w, LPARAM l) { - if(!bFileTransfers) - return CallService(MS_PROTO_CHAINSEND, w, l); CCSDATA *ccs=(CCSDATA*)l; + if(!bFileTransfers) + return Proto_ChainSend(w, ccs); + if(isContactSecured(ccs->hContact)) { char *proto = GetContactProto(ccs->hContact); @@ -581,12 +582,12 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) if(supported_proto && !cap_found) { if(MessageBox(0, TranslateT("Capability to decrypt file not found on other side.\nRecipient may be unable to decrypt file(s).\nDo you want to encrypt file(s) anyway?"), TranslateT("File transfer warning"), MB_YESNO) == IDNO) - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } if(!supported_proto) { if(MessageBox(0, TranslateT("Unable to check encryption support on other side.\nRecipient may be unable to decrypt file(s).\nCurrently capability check supported only for ICQ and Jabber protocols.\nIt will work for any other proto if Miranda with New_GPG is used on other side.\nDo you want to encrypt file(s) anyway?"), TranslateT("File transfer warning"), MB_YESNO) == IDNO) - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } HistoryLog(ccs->hContact, db_event(Translate("encrypting file for transfer"), 0, 0, DBEF_SENT)); DWORD flags = (DWORD)ccs->wParam; //check for PFTS_UNICODE here @@ -627,7 +628,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) } } } - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } @@ -668,7 +669,7 @@ int GetJabberInterface(WPARAM w, LPARAM l) //get interface for all jabber accoun void AddHandlers(); int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); list <JabberAccount*>::iterator p; Accounts.clear(); Accounts.push_back(new JabberAccount); @@ -1572,7 +1573,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) return 1; //TODO: handle error PROTOACCOUNT **accs; int acc_count = 0, processed_keys = 0, processed_private_keys = 0; - ProtoEnumAccounts(&acc_count, &accs); + Proto_EnumAccounts(&acc_count, &accs); char line[256]; file.getline(line, 255); if(!strstr(line, "-----BEGIN PGP PUBLIC KEY BLOCK-----") && !strstr(line, "-----BEGIN PGP PRIVATE KEY BLOCK-----")) diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h index 11b78ad76f..7a2c424978 100644 --- a/plugins/NewsAggregator/Src/Common.h +++ b/plugins/NewsAggregator/Src/Common.h @@ -32,12 +32,12 @@ Boston, MA 02111-1307, USA. #include <m_clist.h>
#include <m_langpack.h>
#include <m_options.h>
+#include <m_protosvc.h>
#include <m_database.h>
#include <m_netlib.h>
#include <m_icolib.h>
#include <m_message.h>
#include <win2k.h>
-#include <m_protomod.h>
#include <m_xml.h>
#include <m_avatars.h>
#include <m_hotkeys.h>
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index a7da89e57d..3b2ef7fd8c 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -150,7 +150,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)MODULE);
+ Proto_AddToContact(hContact, MODULE);
db_set_ts(hContact, MODULE, "Nick", text);
db_set_ts(hContact, MODULE, "URL", url);
db_set_ts(hContact, MODULE, "Homepage", siteurl);
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index 112b90b7ef..fc40b58c16 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -72,7 +72,7 @@ extern "C" __declspec(dllexport) int Load(void) pd.cbSize = sizeof(pd);
pd.szName = MODULE;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(MODULE, PS_GETNAME, NewsAggrGetName);
CreateProtoServiceFunction(MODULE, PS_GETCAPS, NewsAggrGetCaps);
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 40882267b7..b8849fc775 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -54,7 +54,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)MODULE);
+ Proto_AddToContact(hContact, MODULE);
GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "Nick", str);
diff --git a/plugins/Non-IM Contact/src/commonheaders.h b/plugins/Non-IM Contact/src/commonheaders.h index 4a61d0a0ed..2facfdce1d 100644 --- a/plugins/Non-IM Contact/src/commonheaders.h +++ b/plugins/Non-IM Contact/src/commonheaders.h @@ -38,7 +38,6 @@ struct DLGTEMPLATEEX #include <m_clui.h>
#include <m_skin.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_database.h>
#include <m_system.h>
#include <m_icolib.h>
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 86adb17aae..961ec57d88 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -336,7 +336,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) }
free(replace);
hContact2 = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact2, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact2, MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE);
db_set_s(hContact2, MODNAME, "Nick", Translate("New Non-IM Contact"));
// blank dbVar2 so the replaceing doesnt crash..
@@ -396,7 +396,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) msg("contact did not get created", "");
return 0;
}
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact2, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact2, MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE);
db_set_s(hContact2, MODNAME, "Nick", Translate("New Non-IM Contact"));
db_set_s(hContact2, MODNAME, "Name", dbVar1);
@@ -633,7 +633,7 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam) msg("contact did get created", "");
continue;
}
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact, MODNAME);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
db_set_s(hContact, MODNAME, "Name", name);
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp index 1e85c207a5..1565321cb4 100644 --- a/plugins/Non-IM Contact/src/dialog.cpp +++ b/plugins/Non-IM Contact/src/dialog.cpp @@ -303,7 +303,7 @@ INT_PTR addContact(WPARAM wParam, LPARAM lParam) {
char tmp[256];
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact, MODNAME);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
db_set_ts(hContact, MODNAME, "Nick", TranslateT("New Non-IM Contact"));
DoPropertySheet(hContact, hInst);
@@ -319,7 +319,7 @@ INT_PTR editContact(WPARAM wParam, LPARAM lParam) char tmp[256];
if (!hContact) {
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact, MODNAME);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
}
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index 76bdd444de..7b556e486e 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -125,7 +125,7 @@ extern "C" __declspec(dllexport) int Load() HookEvent(ME_CLIST_STATUSMODECHANGE, SetLCStatus);
PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE, MODNAME, PROTOTYPE_VIRTUAL };
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
//load services (the first 5 are the basic ones needed to make a new protocol)
CreateProtoServiceFunction(MODNAME, PS_GETCAPS, GetLCCaps);
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 88c1756f74..8f627acfa2 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -216,8 +216,7 @@ void LoadProtocols(void) int numberOfProtocols = 0;
PROTOACCOUNT **ppProtocolDescriptors;
- INT_PTR ret = ProtoEnumAccounts(&numberOfProtocols, &ppProtocolDescriptors);
- if (ret == 0)
+ Proto_EnumAccounts(&numberOfProtocols, &ppProtocolDescriptors);
for (int i = 0; i < numberOfProtocols; i++)
Nudge_AddAccount(ppProtocolDescriptors[i]);
diff --git a/plugins/OpenSSL/src/commonheaders.h b/plugins/OpenSSL/src/commonheaders.h index 149c1e85b7..99b3c76c9a 100644 --- a/plugins/OpenSSL/src/commonheaders.h +++ b/plugins/OpenSSL/src/commonheaders.h @@ -50,7 +50,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h> #include <m_button.h> #include <m_protosvc.h> -#include <m_protomod.h> #include <m_protocols.h> #include <m_options.h> #include <m_skin.h> diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index cab4183c93..0e99ed7778 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcDestEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l int num_protocols = 0;
PROTOACCOUNT **pppDesc;
- ProtoEnumAccounts(&num_protocols, &pppDesc);
+ Proto_EnumAccounts(&num_protocols, &pppDesc);
for (int i = 0; i < num_protocols; i++)
SendDlgItemMessage(hwndDlg, IDC_COMBO_DESTPROTO, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)pppDesc[i]->tszAccountName);
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index f5191a64e7..c0465a06a0 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -56,7 +56,7 @@ void SetProtoStatus(TCHAR *pszLabel, char *pszProto, int if_status, int new_stat int num_protocols;
PROTOACCOUNT **pppDesc;
- ProtoEnumAccounts(&num_protocols, &pppDesc);
+ Proto_EnumAccounts(&num_protocols, &pppDesc);
for (int i = 0; i < num_protocols; i++) {
SetProtoStatus(pszLabel, pppDesc[i]->szModuleName, if_status, new_status);
}
@@ -230,9 +230,7 @@ void __cdecl sttCheckStatusThreadProc(void *vp) upCount = count;
total = index;
}
- else {
- total = 0;
- }
+ else total = 0;
}
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 9d11296629..129f16fafe 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -204,7 +204,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
int protocolCount = 0;
PROTOACCOUNT **protocols;
- ProtoEnumAccounts(&protocolCount, &protocols);
+ Proto_EnumAccounts(&protocolCount, &protocols);
DWORD globalFlags = 0;
for (int i = 0; i < protocolCount; ++i) {
if (!protocols[i]->bIsVirtual) {
@@ -521,7 +521,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
int protocolCount;
PROTOACCOUNT **protocols;
- ProtoEnumAccounts(&protocolCount, &protocols);
+ Proto_EnumAccounts(&protocolCount, &protocols);
for (int i = 0; i < protocolCount; ++i) {
if (!protocols[i]->bIsVirtual) {
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 0e6c805738..3a2ea7b491 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -112,7 +112,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) int pcount = 0;
PROTOACCOUNT** pdesc;
- ProtoEnumAccounts(&pcount,&pdesc);
+ Proto_EnumAccounts(&pcount,&pdesc);
opts.num_protos = pcount;
@@ -410,7 +410,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) TCHAR *tmp = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
mir_tstrncpy(contact->szname, tmp, SIZEOF(contact->szname));
- PROTOACCOUNT *acc = ProtoGetAccount(pszProto);
+ PROTOACCOUNT *acc = Proto_GetAccount(pszProto);
if (acc != NULL)
mir_tstrncpy(contact->proto, acc->tszAccountName, SIZEOF(contact->proto));
diff --git a/plugins/QuickMessages/src/quickmessages.h b/plugins/QuickMessages/src/quickmessages.h index e40ef0c385..044d0137c7 100644 --- a/plugins/QuickMessages/src/quickmessages.h +++ b/plugins/QuickMessages/src/quickmessages.h @@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_clist.h>
#include <m_options.h>
#include <m_utils.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_icolib.h>
#include <m_message.h>
diff --git a/plugins/QuickSearch/sr_global.pas b/plugins/QuickSearch/sr_global.pas index b7431f54ca..2f7e59c2c0 100644 --- a/plugins/QuickSearch/sr_global.pas +++ b/plugins/QuickSearch/sr_global.pas @@ -373,7 +373,7 @@ begin width :=82;
flags :=COL_ON;
setting_type :=QST_SERVICE;
- StrDup (service.service,MS_PROTO_GETCONTACTBASEACCOUNT);
+ StrDup (service.service,'Proto/GetContactBaseAccount');
service.flags :=ACF_TYPE_STRING;
service.w_flags:=ACF_TYPE_PARAM;
service.l_flags:=ACF_TYPE_NUMBER;
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 6693535fe9..289696bb4d 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -441,16 +441,13 @@ extern "C" Quotes_IconsInit();
Quotes_InitExtraIcons();
- PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
+ PROTOCOLDESCRIPTOR pd = { 0 };
+ pd.cbSize = PROTOCOLDESCRIPTOR_V3_SIZE;
pd.szName = QUOTES_PROTOCOL_NAME;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
- // CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETNAME, QuoteProtoFunc_GetName);
- // CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETCAPS, QuoteProtoFunc_GetCaps);
- // CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_SETSTATUS, QuoteProtoFunc_SetStatus);
CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETSTATUS, QuoteProtoFunc_GetStatus);
- // CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_LOADICON, QuoteProtoFunc_LoadIcon);
HookEvent(ME_SYSTEM_MODULESLOADED, QuotesEventFunc_OnModulesLoaded);
HookEvent(ME_DB_CONTACT_DELETED, QuotesEventFunc_OnContactDeleted);
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index 74dbfc01f0..a0d1ff989b 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -573,7 +573,7 @@ namespace dbei.timestamp = static_cast<DWORD>(nTime);
dbei.flags = DBEF_READ | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = ::mir_strlen(psz) + 1;
+ dbei.cbBlob = (int)::mir_strlen(psz) + 1;
dbei.pBlob = (PBYTE)(char*)psz;
db_event_add(hContact, &dbei);
}
@@ -818,7 +818,7 @@ MCONTACT CQuotesProviderBase::CreateNewContact(const tstring& rsName) {
MCONTACT hContact = MCONTACT(CallService(MS_DB_CONTACT_ADD, 0, 0));
if (hContact) {
- if (0 == CallService(MS_PROTO_ADDTOCONTACT, WPARAM(hContact), (LPARAM)QUOTES_PROTOCOL_NAME)) {
+ if (0 == Proto_AddToContact(hContact, QUOTES_PROTOCOL_NAME)) {
tstring sProvName = GetInfo().m_sName;
db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_PROVIDER, sProvName.c_str());
db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL, rsName.c_str());
diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h index fe6920d233..7ee55294c5 100644 --- a/plugins/Quotes/src/stdafx.h +++ b/plugins/Quotes/src/stdafx.h @@ -21,11 +21,11 @@ #include <newpluginapi.h>
#include <m_database.h>
-#include <m_protomod.h>
#include <win2k.h>
#include <m_xml.h>
#include <m_langpack.h>
#include <m_options.h>
+#include <m_protosvc.h>
#include <m_extraicons.h>
#include <m_icolib.h>
#include <m_genmenu.h>
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index aaef72e0a9..1444053de8 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -198,11 +198,10 @@ void SetProtocolsOffline() {
if ( GetSettingBool("GlobalSettings", "SetProtocolsOffline", TRUE) ) {
PROTOACCOUNT **accounts;
- int i,count;
-
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accounts);
+ int count;
+ Proto_EnumAccounts(&count, &accounts);
- for (i = 0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
/*if (protos[i]->type != PROTOTYPE_PROTOCOL)
continue;*/
if (!accounts[i]->bIsEnabled)
@@ -324,9 +323,7 @@ void RemoveSettings() if ( GetSettingBool("GlobalSettings", "RemoveProtocolSettings", TRUE) ) {
PROTOACCOUNT **accounts;
int i,count;
-
- // TODO MS_PROTO_ENUMACCOUNTS
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accounts);
+ Proto_EnumAccounts(&count, &accounts);
for (i = 0; i < count; i++) {
/*if (protos[i]->type != PROTOTYPE_PROTOCOL)
@@ -434,11 +431,10 @@ void RemoveDirectories() // Remove protocol folders
if (GetSettingBool("GlobalSettings", "RemoveProtocolFolders", TRUE)) {
PROTOACCOUNT **accounts;
- int i,count;
-
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accounts);
+ int count;
+ Proto_EnumAccounts(&count, &accounts);
- for (i = 0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
/*if (protos[i]->type != PROTOTYPE_PROTOCOL)
continue;*/
if (!accounts[i]->bIsEnabled)
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index e407e26228..da12ae052a 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -502,13 +502,13 @@ int RefreshAccountList(WPARAM eventCode,LPARAM lParam) int dwAccCount=0,dwSMSAccountsCount=0;
PROTOACCOUNT **ppaAccounts;
- ProtoEnumAccounts((int*)&dwAccCount,&ppaAccounts);
+ Proto_EnumAccounts((int*)&dwAccCount,&ppaAccounts);
FreeAccountList();
ssSMSSettings.ppaSMSAccounts=(PROTOACCOUNT**)MEMALLOC((dwAccCount*sizeof(LPVOID)));
if (ssSMSSettings.ppaSMSAccounts)
for (int i=0; i < dwAccCount; i++)
- if ( IsAccountEnabled(ppaAccounts[i]))
+ if ( Proto_IsAccountEnabled(ppaAccounts[i]))
if ( ProtoServiceExists(ppaAccounts[i]->szModuleName,MS_ICQ_SENDSMS))
ssSMSSettings.ppaSMSAccounts[dwSMSAccountsCount++] = ppaAccounts[i];
diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h index ff3e798807..53ed0d2758 100644 --- a/plugins/Scriver/src/chat/chat.h +++ b/plugins/Scriver/src/chat/chat.h @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _CHAT_H_
#define _CHAT_H_
-#include <m_protomod.h>
#include <m_chat_int.h>
#define EM_ACTIVATE (WM_USER+202)
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 70902bc0b5..c1071ad415 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -65,9 +65,9 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto) tokenLen[2] = j;
}
- char *accModule = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0);
+ char *accModule = Proto_GetBaseAccountName(hContact);
if (accModule != NULL) {
- PROTOACCOUNT* proto = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)accModule);
+ PROTOACCOUNT* proto = Proto_GetAccount(accModule);
if (proto != NULL) {
tokens[3] = mir_tstrdup(proto->tszAccountName);
tokenLen[3] = mir_tstrlen(tokens[3]);
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index f416e46339..18908fb146 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -22,7 +22,7 @@ #include <win2k.h>
#include <newpluginapi.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 3ea94b4b62..8d1fcc1fd0 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -21,7 +21,7 @@ void loadSupportedProtocols() int numberOfProtocols;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&numberOfProtocols, &protos);
+ Proto_EnumAccounts(&numberOfProtocols, &protos);
for (int i = 0; i < numberOfProtocols; i++) {
if (!protos[i]->szModuleName || !CallProtoService(protos[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0))
@@ -67,7 +67,7 @@ void freeSupportedProtocols() pSupPro getSupPro(MCONTACT hContact)
{
for (int j = 0; j < arProto.getCount(); j++)
- if (CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)arProto[j]->name))
+ if (Proto_IsProtoOnContact(hContact, arProto[j]->name))
return arProto[j];
return NULL;
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 3c77fe47c2..ab5c5de63f 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -346,7 +346,7 @@ extern "C" __declspec(dllexport) int __cdecl Load(void) pd.cbSize = sizeof(pd);
pd.szName = (char*)MODULENAME;
pd.type = PROTOTYPE_ENCRYPTION;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// hook events
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index 13a3ee9445..f9e690f68a 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -48,28 +48,28 @@ LPSTR szUnrtfMsg = NULL; // RecvMsg handler
INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *pccsd = (CCSDATA *)lParam;
- PROTORECVEVENT *ppre = (PROTORECVEVENT *)pccsd->lParam;
- pUinKey ptr = getUinKey(pccsd->hContact);
+ CCSDATA *ccs = (CCSDATA *)lParam;
+ PROTORECVEVENT *ppre = (PROTORECVEVENT *)ccs->lParam;
+ pUinKey ptr = getUinKey(ccs->hContact);
LPSTR szEncMsg = ppre->szMessage, szPlainMsg = NULL;
Sent_NetLog("onRecvMsg: %s", szEncMsg);
int ssig = getSecureSig(ppre->szMessage, &szEncMsg);
- bool bSecured = (isContactSecured(pccsd->hContact)&SECURED) != 0;
- bool bPGP = isContactPGP(pccsd->hContact);
- bool bGPG = isContactGPG(pccsd->hContact);
+ bool bSecured = (isContactSecured(ccs->hContact)&SECURED) != 0;
+ bool bPGP = isContactPGP(ccs->hContact);
+ bool bGPG = isContactGPG(ccs->hContact);
// pass any unchanged message
- if (!ptr || ssig == SiG_GAME || !isSecureProtocol(pccsd->hContact) ||
- (db_mc_isMeta(pccsd->hContact) && (pccsd->wParam & PREF_SIMNOMETA)) || isChatRoom(pccsd->hContact) ||
+ if (!ptr || ssig == SiG_GAME || !isSecureProtocol(ccs->hContact) ||
+ (db_mc_isMeta(ccs->hContact) && (ccs->wParam & PREF_SIMNOMETA)) || isChatRoom(ccs->hContact) ||
(ssig == SiG_NONE && !ptr->msgSplitted && !bSecured && !bPGP && !bGPG)) {
Sent_NetLog("onRecvMsg: pass unhandled");
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
}
// drop message: fake, unsigned or from invisible contacts
- if (isContactInvisible(pccsd->hContact) || ssig == SiG_FAKE) {
+ if (isContactInvisible(ccs->hContact) || ssig == SiG_FAKE) {
Sent_NetLog("onRecvMsg: drop unhandled (contact invisible or hidden)");
return 1;
}
@@ -80,8 +80,8 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) ptrA szPlainMsg(m_aastrcat(Translate(sim402), szEncMsg));
ppre->szMessage = szPlainMsg;
- pccsd->wParam |= PREF_SIMNOMETA;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ ccs->wParam |= PREF_SIMNOMETA;
+ return Proto_ChainRecv(wParam, ccs);
}
// received non-pgp secure message from disabled contact
@@ -90,12 +90,12 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) if (ptr->mode == MODE_NATIVE) {
// tell to the other side that we have the plugin disabled with him
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)SIG_DISA;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)SIG_DISA;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
- showPopup(sim003, pccsd->hContact, g_hPOP[POP_PU_DIS], 0);
+ showPopup(sim003, ccs->hContact, g_hPOP[POP_PU_DIS], 0);
}
else {
createRSAcntx(ptr);
@@ -133,7 +133,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) szEncMsg = ppre->szMessage;
if (!ptr->cntx) {
- ptr->cntx = cpp_create_context(((bGPGloaded && bGPGkeyrings) ? CPP_MODE_GPG : CPP_MODE_PGP) | ((db_get_b(pccsd->hContact, MODULENAME, "gpgANSI", 0)) ? CPP_MODE_GPG_ANSI : 0));
+ ptr->cntx = cpp_create_context(((bGPGloaded && bGPGkeyrings) ? CPP_MODE_GPG : CPP_MODE_PGP) | ((db_get_b(ccs->hContact, MODULENAME, "gpgANSI", 0)) ? CPP_MODE_GPG_ANSI : 0));
ptr->keyLoaded = 0;
}
@@ -153,30 +153,30 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) if (!szOldMsg) { // error while decrypting message, send error
SAFE_FREE(ptr->msgSplitted);
ppre->szMessage = Translate(sim401);
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
}
// receive encrypted message in non-encrypted mode
- if (!isContactPGP(pccsd->hContact) && !isContactGPG(pccsd->hContact)) {
+ if (!isContactPGP(ccs->hContact) && !isContactGPG(ccs->hContact)) {
szNewMsg = m_ustrcat(Translate(sim403), szOldMsg);
szOldMsg = szNewMsg;
}
ptrA szMsgUtf(utf8_to_miranda(szOldMsg, ppre->flags));
- pccsd->wParam = ppre->flags;
+ ccs->wParam = ppre->flags;
ppre->szMessage = szMsgUtf;
// show decoded message
showPopupRM(ptr->hContact);
SAFE_FREE(ptr->msgSplitted);
- pccsd->wParam |= PREF_SIMNOMETA;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ ccs->wParam |= PREF_SIMNOMETA;
+ return Proto_ChainRecv(wParam, ccs);
}
Sent_NetLog("onRecvMsg: switch(ssig)=%d", ssig);
switch (ssig) {
case SiG_PGPM:
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
case SiG_SECU: // new secured msg, pass to rsa_recv
Sent_NetLog("onRecvMsg: RSA/AES message");
@@ -197,14 +197,14 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) return 1; // don't display it ...
ptrA szNewMsg(utf8_to_miranda(szOldMsg, ppre->flags));
- pccsd->wParam = ppre->flags;
+ ccs->wParam = ppre->flags;
ppre->szMessage = szNewMsg;
// show decoded message
showPopupRM(ptr->hContact);
SAFE_FREE(ptr->msgSplitted);
- pccsd->wParam |= PREF_SIMNOMETA;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ ccs->wParam |= PREF_SIMNOMETA;
+ return Proto_ChainRecv(wParam, ccs);
}
case SiG_ENON: // online message
@@ -228,14 +228,14 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) mir_strcpy(reSend, SIG_RSND); // copy resend sig
mir_strcat(reSend, szEncMsg); // add mess
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)reSend; // reSend Message to reemit
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam); // send back cipher message
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)reSend; // reSend Message to reemit
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs); // send back cipher message
ptrA keyToSend(InitKeyA(ptr, 0)); // calculate public and private key
- pccsd->lParam = keyToSend;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam); // send new key
+ ccs->lParam = keyToSend;
+ Proto_ChainSend(wParam, ccs); // send new key
showPopup(sim005, NULL, g_hPOP[POP_PU_DIS], 0);
showPopupKS(ptr->hContact);
@@ -256,7 +256,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
dbv.type = DBVT_BLOB;
if (db_get(ptr->hContact, MODULENAME, "offlineKey", &dbv))
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam); // exit and show messsage
+ return Proto_ChainRecv(wParam, ccs); // exit and show messsage
// if valid key is succefully retrieved
ptr->offlineKey = true;
@@ -273,7 +273,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) if (cpp_keyx(ptr->cntx)) {
// decrypt sended back message and save message for future sending with a new secret key
- addMsg2Queue(ptr, pccsd->wParam, ptrA(decodeMsg(ptr, (LPARAM)pccsd, szEncMsg)));
+ addMsg2Queue(ptr, ccs->wParam, ptrA(decodeMsg(ptr, (LPARAM)ccs, szEncMsg)));
showPopupRM(ptr->hContact);
showPopup(sim004, NULL, g_hPOP[POP_PU_DIS], 0);
}
@@ -336,8 +336,8 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) loadRSAkey(ptr);
exp->rsa_connect(ptr->cntx);
- showPopupKS(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ showPopupKS(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
return 1;
}
@@ -348,10 +348,10 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) ptrA keyToSend(InitKeyA(ptr, CPP_FEATURES_NEWPG | KEY_A_SIG)); // calculate NEW public and private key
Sent_NetLog("onRecvMsg: Sending KEYA %s", keyToSend);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)keyToSend;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)keyToSend;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
showPopupKS(ptr->hContact);
waitForExchange(ptr); // çàïóñòèì îæèäàíèå
@@ -363,10 +363,10 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) ptrA keyToSend(InitKeyA(ptr, 0)); // calculate public and private key
Sent_NetLog("onRecvMsg: Sending KEYA %s", keyToSend);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)keyToSend;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)keyToSend;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
showPopupKS(ptr->hContact);
}
@@ -393,10 +393,10 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) ptrA keyToSend(InitKeyA(ptr, CPP_FEATURES_NEWPG | KEY_B_SIG)); // calculate NEW public and private key
Sent_NetLog("onRecvMsg: Sending KEYB %s", keyToSend);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = keyToSend;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = keyToSend;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
}
break;
@@ -441,8 +441,8 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) Sent_NetLog("onRecvMsg: exit");
- pccsd->wParam |= PREF_SIMNOMETA;
- int ret = CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ ccs->wParam |= PREF_SIMNOMETA;
+ int ret = Proto_ChainRecv(wParam, ccs);
SAFE_FREE(szPlainMsg);
return ret;
}
@@ -450,19 +450,19 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) // SendMsg handler
INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *pccsd = (CCSDATA*)lParam;
- pUinKey ptr = getUinKey(pccsd->hContact);
- int ssig = getSecureSig((LPCSTR)pccsd->lParam);
- int stat = getContactStatus(pccsd->hContact);
+ CCSDATA *ccs = (CCSDATA*)lParam;
+ pUinKey ptr = getUinKey(ccs->hContact);
+ int ssig = getSecureSig((LPCSTR)ccs->lParam);
+ int stat = getContactStatus(ccs->hContact);
- Sent_NetLog("onSend: %s", (LPSTR)pccsd->lParam);
+ Sent_NetLog("onSend: %s", (LPSTR)ccs->lParam);
// pass unhandled messages
if (!ptr || ssig == SiG_GAME || ssig == SiG_PGPM || ssig == SiG_SECU || ssig == SiG_SECP ||
- isChatRoom(pccsd->hContact) || stat == -1 ||
+ isChatRoom(ccs->hContact) || stat == -1 ||
(ssig == SiG_NONE && ptr->sendQueue) || (ssig == SiG_NONE && ptr->status == STATUS_DISABLED)) {
Sent_NetLog("onSendMsg: pass unhandled");
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
//
@@ -479,28 +479,28 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) }
if (!ptr->keyLoaded && bPGPloaded) ptr->keyLoaded = LoadKeyPGP(ptr);
if (!ptr->keyLoaded && bGPGloaded) ptr->keyLoaded = LoadKeyGPG(ptr);
- if (!ptr->keyLoaded) return returnError(pccsd->hContact, Translate(sim108));
+ if (!ptr->keyLoaded) return returnError(ccs->hContact, Translate(sim108));
LPSTR szNewMsg = NULL;
- ptrA szUtfMsg(miranda_to_utf8((LPCSTR)pccsd->lParam, pccsd->wParam));
+ ptrA szUtfMsg(miranda_to_utf8((LPCSTR)ccs->lParam, ccs->wParam));
if (ptr->keyLoaded == 1) // PGP
szNewMsg = pgp_encode(ptr->cntx, szUtfMsg);
else if (ptr->keyLoaded == 2) // GPG
szNewMsg = gpg_encode(ptr->cntx, szUtfMsg);
if (!szNewMsg)
- return returnError(pccsd->hContact, Translate(sim109));
+ return returnError(ccs->hContact, Translate(sim109));
// îòïðàâëÿåì çàøèôðîâàííîå ñîîáùåíèå
splitMessageSend(ptr, szNewMsg);
showPopupSM(ptr->hContact);
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// îòïðàâëÿåì íåçàøèôðîâàííîå
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
// get contact SecureIM status
@@ -523,16 +523,16 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) if (!bSOM || (!isClientMiranda(ptr, 1) && !isSecureIM(ptr, 1)) || !loadRSAkey(ptr)) {
if (ssig == SiG_NONE)
// ïðîñòî øëåì íåçàøèôðîâàííîå â îôôëàéí
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
// íè÷åãî íå øëåì äàëüøå - ýòî ñëóæåáíîå ñîîáùåíèå
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// øëåì øèôðîâàííîå â îôôëàéí
- exp->rsa_send(ptr->cntx, ptrA(miranda_to_utf8((LPCSTR)pccsd->lParam, pccsd->wParam)));
+ exp->rsa_send(ptr->cntx, ptrA(miranda_to_utf8((LPCSTR)ccs->lParam, ccs->wParam)));
showPopupSM(ptr->hContact);
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// SecureIM connection with this contact is disabled
@@ -543,10 +543,10 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) }
if (ssig == SiG_NONE) // ïðîñòî øëåì íåçàøèôðîâàííîå
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
// íè÷åãî íå øëåì äàëüøå - ýòî ñëóæåáíîå ñîîáùåíèå
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// ðàçîðâàòü ñîåäèíåíèå
@@ -557,21 +557,21 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) }
ShowStatusIconNotify(ptr->hContact);
waitForExchange(ptr, 3); // äîøëåì íåøèôðîâàííî
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// ñîåäèíåíèå óñòàíîâëåíî
if (ptr->cntx && exp->rsa_get_state(ptr->cntx) == 7) {
- exp->rsa_send(ptr->cntx, ptrA(miranda_to_utf8((LPCSTR)pccsd->lParam, pccsd->wParam)));
+ exp->rsa_send(ptr->cntx, ptrA(miranda_to_utf8((LPCSTR)ccs->lParam, ccs->wParam)));
ShowStatusIconNotify(ptr->hContact);
showPopupSM(ptr->hContact);
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// ïðîñòî ñîîáùåíèå (áåç òýãîâ, íåò êîíòåêñòà è ðàáîòàþò AIP & NOL)
if (ssig == SiG_NONE && isSecureIM(ptr->hContact)) {
// äîáàâèì åãî â î÷åðåäü
- addMsg2Queue(ptr, pccsd->wParam, (LPSTR)pccsd->lParam);
+ addMsg2Queue(ptr, ccs->wParam, (LPSTR)ccs->lParam);
// çàïóñêàåì ïðîöåññ óñòàíîâêè ñîåäèíåíèÿ
ssig = SiG_INIT;
// çàïóñêàåì òðýä îæèäàíèÿ è äîñûëêè
@@ -583,13 +583,13 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) createRSAcntx(ptr);
loadRSAkey(ptr);
exp->rsa_connect(ptr->cntx);
- showPopupKS(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
- return returnNoError(pccsd->hContact);
+ showPopupKS(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
+ return returnNoError(ccs->hContact);
}
// ïðîñòî øëåì íåçàøèôðîâàííîå (íå çíàþ äàæå êîãäà òàêîå ñëó÷èòñÿ)
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
//
@@ -603,7 +603,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) // if user try initialize connection
if (ssig == SiG_INIT) // secure IM is disabled ...
- return returnError(pccsd->hContact, Translate(sim105));
+ return returnError(ccs->hContact, Translate(sim105));
if (ptr->cntx) { // if secure context exists
cpp_delete_context(ptr->cntx); ptr->cntx = 0;
@@ -611,15 +611,15 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) CCSDATA ccsd;
memcpy(&ccsd, (HLOCAL)lParam, sizeof(CCSDATA));
- pccsd->wParam |= PREF_METANODB;
+ ccs->wParam |= PREF_METANODB;
ccsd.lParam = (LPARAM)SIG_DEIN;
ccsd.szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, (LPARAM)&ccsd);
+ Proto_ChainSend(wParam, &ccsd);
- showPopupDC(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ showPopupDC(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
}
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
// contact is offline
@@ -631,10 +631,10 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) if (!bSOM) {
if (ssig != SiG_NONE)
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
// exit and send unencrypted message
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
BOOL isMiranda = isClientMiranda(ptr->hContact);
@@ -652,18 +652,18 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) db_unset(ptr->hContact, MODULENAME, "offlineKey");
db_unset(ptr->hContact, MODULENAME, "offlineKeyTimeout");
if (msgbox1(0, sim106, MODULENAME, MB_YESNO | MB_ICONQUESTION) == IDNO)
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
// exit and send unencrypted message
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
}
else {
if (ssig != SiG_NONE)
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
// exit and send unencrypted message
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
}
else {
@@ -691,31 +691,31 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) if (ptr->cntx) {
cpp_delete_context(ptr->cntx); ptr->cntx = 0;
- pccsd->wParam |= PREF_METANODB;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ Proto_ChainSend(wParam, ccs);
- showPopupDC(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ showPopupDC(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
}
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
if (cpp_keya(ptr->cntx) && cpp_keyb(ptr->cntx) && !cpp_keyx(ptr->cntx))
CalculateKeyX(ptr, ptr->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ ShowStatusIconNotify(ccs->hContact);
// if cryptokey exist
if (cpp_keyx(ptr->cntx)) {
Sent_NetLog("onSendMsg: cryptokey exist");
- ptrA szNewMsg(encodeMsg(ptr, (LPARAM)pccsd));
+ ptrA szNewMsg(encodeMsg(ptr, (LPARAM)ccs));
Sent_NetLog("onSend: encrypted msg '%s'", szNewMsg);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = szNewMsg;
- pccsd->szProtoService = PSS_MESSAGE;
- int ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = szNewMsg;
+ ccs->szProtoService = PSS_MESSAGE;
+ int ret = Proto_ChainSend(wParam, ccs);
showPopupSM(ptr->hContact);
return ret;
@@ -726,26 +726,26 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) // send KeyA if init || always_try || waitkey || always_if_possible
if (ssig == SiG_INIT || (stid == STATUS_ALWAYSTRY && isClientMiranda(ptr->hContact)) || isSecureIM(ptr->hContact) || ptr->waitForExchange) {
if (ssig == SiG_NONE)
- addMsg2Queue(ptr, pccsd->wParam, (LPSTR)pccsd->lParam);
+ addMsg2Queue(ptr, ccs->wParam, (LPSTR)ccs->lParam);
if (!ptr->waitForExchange) {
// init || always_try || always_if_possible
ptrA keyToSend(InitKeyA(ptr, 0)); // calculate public and private key & fill KeyA
Sent_NetLog("Sending KEY3: %s", keyToSend);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)keyToSend;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)keyToSend;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
- showPopupKS(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ showPopupKS(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
waitForExchange(ptr); // çàïóñêàåì îæèäàíèå
}
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
Sent_NetLog("onSendMsg: pass unchanged to chain");
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index cd635e746f..e51c8dad93 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -234,7 +234,7 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM PROTOACCOUNT **protos;
int numberOfProtocols;
- ProtoEnumAccounts(&numberOfProtocols, &protos);
+ Proto_EnumAccounts(&numberOfProtocols, &protos);
for (int i = 0; i < numberOfProtocols; i++) {
if (CallProtoService(protos[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 98c6e34c68..ea0df3cb61 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -51,7 +51,7 @@ int IsWatchedProtocol(const char* szProto) if (szProto == NULL)
return 0;
- PROTOACCOUNT *pd = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pd = Proto_GetAccount(szProto);
if (pd == NULL || CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
return 0;
@@ -372,7 +372,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) case 'A':
{
- PROTOACCOUNT *pa = ProtoGetAccount(ci.szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(ci.szProto);
if (!pa) goto LBL_noData;
_tcsncpy(szdbsetting, pa->tszAccountName, SIZEOF(szdbsetting));
charPtr = szdbsetting;
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index 3cf30d20d1..c77d6f3d86 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -193,7 +193,8 @@ void ipcGetSkinIcons(THeaderIPC *ipch) int protoCount;
PROTOACCOUNT **pp;
- if (ProtoEnumAccounts(&protoCount,&pp) == 0 && protoCount != 0) {
+ Proto_EnumAccounts(&protoCount,&pp);
+ if (protoCount != 0) {
spi.pid = GetCurrentProcessId();
while (protoCount > 0) {
PROTOACCOUNT *pa = *pp;
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 023e3e37c4..4f100ffca0 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -481,7 +481,7 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat) {
for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -699,7 +699,7 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam) for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -756,7 +756,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA int status;
for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -793,7 +793,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -877,7 +877,7 @@ INT_PTR ShowStatusMessageDialogInternal(WPARAM wParam, LPARAM lParam) {
for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -896,7 +896,7 @@ INT_PTR ShowStatusMessageDialogInternal(WPARAM wParam, LPARAM lParam) {
for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -946,7 +946,7 @@ INT_PTR ShowStatusMessageDialog(WPARAM wParam, LPARAM lParam) for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1002,7 +1002,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (accounts->statusMsgCount == 1 && !szProto) {
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1111,7 +1111,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (!bShowDlg || bScreenSaverRunning || (iProtoFlags & PROTO_NOCHANGE && !bOnStartup)) {
TCHAR *msg = NULL;
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1255,7 +1255,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO // is global status mode going to be set?
for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1293,7 +1293,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1313,7 +1313,7 @@ VOID CALLBACK SetStartupStatusProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1353,7 +1353,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1434,11 +1434,11 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) int iStatusMenuItemCount = 0, count;
DWORD iStatusMsgFlags = 0;
- ProtoEnumAccounts(&count, &pa);
+ Proto_EnumAccounts(&count, &pa);
hProtoStatusMenuItem = (HANDLE *)mir_realloc(hProtoStatusMenuItem, sizeof(HANDLE) * count);
for (int i = 0; i < count; ++i)
{
- if (!IsAccountEnabled(pa[i]))
+ if (!Proto_IsAccountEnabled(pa[i]))
continue;
if (CallProtoService(pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)
@@ -1468,7 +1468,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) for (int i = 0; i < count; ++i)
{
- if (!IsAccountEnabled(pa[i]))
+ if (!Proto_IsAccountEnabled(pa[i]))
continue;
if (!CallProtoService(pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1487,13 +1487,13 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) continue;
TCHAR szBuffer[256];
- if (CallService(MS_PROTO_ISACCOUNTLOCKED,0,(LPARAM)pa[i]->szModuleName))
+ if (Proto_IsAccountLocked(pa[i]->szModuleName))
{
mir_sntprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
mi.ptszPopupName = szBuffer;
}
- else
- mi.ptszPopupName = pa[i]->tszAccountName;
+ else mi.ptszPopupName = pa[i]->tszAccountName;
+
hProtoStatusMenuItem[i] = Menu_AddStatusMenuItem(&mi);
}
@@ -1521,7 +1521,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
@@ -1722,9 +1722,9 @@ static int OnAccListChanged(WPARAM wParam, LPARAM lParam) accounts->statusMsgCount = 0;
UnhookProtoEvents();
- ProtoEnumAccounts(&accounts->count, &accounts->pa);
+ Proto_EnumAccounts(&accounts->count, &accounts->pa);
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!mir_strcmp(accounts->pa[i]->szProtoName, "ICQ"))
@@ -1816,7 +1816,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) else {
g_uSetStatusTimer = (UINT_PTR *)mir_alloc(sizeof(UINT_PTR) * accounts->count);
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1838,7 +1838,7 @@ static int OnOkToExit(WPARAM, LPARAM) char szSetting[80];
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index 9bbd4adc5c..083a0aa7e1 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -648,7 +648,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) } db_set_s(NULL, "SimpleStatusMsg", "LastMsg", ""); for (i = 0; i < accounts->count; i++) { - if (!IsAccountEnabled(accounts->pa[i])) + if (!Proto_IsAccountEnabled(accounts->pa[i])) continue; if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)) @@ -780,7 +780,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) TCHAR szTitle[256], szProtoName[128]; BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND); - mir_sntprintf(szProtoName, SIZEOF(szProtoName), msgbox_data->m_szProto ? ProtoGetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_sntprintf(szProtoName, SIZEOF(szProtoName), msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); if (iStatus == ID_STATUS_CURRENT) { if (msgbox_data->m_bOnStartup) mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName); @@ -905,7 +905,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg); init_data = (struct MsgBoxInitData *)lParam; GetWindowText(hwndDlg, szFormat, SIZEOF(szFormat)); - mir_sntprintf(szProtoName, SIZEOF(szProtoName), init_data->m_szProto ? ProtoGetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_sntprintf(szProtoName, SIZEOF(szProtoName), init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); if (init_data->m_iStatus == ID_STATUS_CURRENT) { if (init_data->m_bOnStartup) @@ -1138,7 +1138,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", ""); for (int j = 0; j < accounts->count; j++) { - if (!IsAccountEnabled(accounts->pa[j])) + if (!Proto_IsAccountEnabled(accounts->pa[j])) continue; if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)) @@ -1188,7 +1188,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff); for (int j = 0; j < accounts->count; j++) { - if (!IsAccountEnabled(accounts->pa[j])) + if (!Proto_IsAccountEnabled(accounts->pa[j])) continue; if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)) @@ -1236,7 +1236,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff); for (int j = 0; j < accounts->count; j++) { - if (!IsAccountEnabled(accounts->pa[j])) + if (!Proto_IsAccountEnabled(accounts->pa[j])) continue; if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)) diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 44208ff54c..931ceaa6bf 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -143,7 +143,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (j = 0; j < accounts->count; j++)
{
- if (!IsAccountEnabled(accounts->pa[j]) || !CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
+ if (!Proto_IsAccountEnabled(accounts->pa[j]) || !CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
mir_snprintf(setting, "%sFlags", accounts->pa[j]->szModuleName);
@@ -190,7 +190,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i])
+ if (!Proto_IsAccountEnabled(accounts->pa[i])
|| !CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)
|| !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
{
@@ -931,7 +931,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (k = 0; k < accounts->count; k++)
{
- if (!IsAccountEnabled(accounts->pa[k]) || !CallProtoService(accounts->pa[k]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[k]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
+ if (!Proto_IsAccountEnabled(accounts->pa[k]) || !CallProtoService(accounts->pa[k]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[k]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
if (k != j - 1)
@@ -1020,7 +1020,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (int j = 0; j < accounts->count; j++)
{
- if (!IsAccountEnabled(accounts->pa[j]))
+ if (!Proto_IsAccountEnabled(accounts->pa[j]))
continue;
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
@@ -1046,7 +1046,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (i = 0; i < accounts->count; i++)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1351,7 +1351,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w }
db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
for (i = 0; i < accounts->count; i++) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1451,7 +1451,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa data->setdelay = (int *)mir_alloc(sizeof(int) * accounts->count);
for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
index = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_ADDSTRING, 0, (LPARAM)accounts->pa[i]->tszAccountName);
@@ -1637,7 +1637,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa char szSetting[80];
for (int i = 0; i < accounts->count; i++)
{
- if (!IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
mir_snprintf(szSetting, "Startup%sStatus", accounts->pa[i]->szModuleName);
diff --git a/plugins/SkypeStatusChange/src/options.cpp b/plugins/SkypeStatusChange/src/options.cpp index f2ed13bfc0..5fc56c5a53 100644 --- a/plugins/SkypeStatusChange/src/options.cpp +++ b/plugins/SkypeStatusChange/src/options.cpp @@ -46,7 +46,7 @@ void InitProtocolTree(HWND hDlg,HWND hwndTreeCtrl) enum{OFFLINE_STATUS_INDEX = 5};
- ProtoEnumAccounts(&cAccounts, &ppAccount);
+ Proto_EnumAccounts(&cAccounts, &ppAccount);
for(int i = 0; i < cAccounts;++i)
{
PROTOACCOUNT* pAccount = ppAccount[i];
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 63b79d169b..3c568b9735 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -832,7 +832,7 @@ bool SmileyCategoryListType::DeleteCustomCategory(int index) void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMString& defaultFile)
{
- if (IsAccountEnabled(acc) && acc->szProtoName && IsSmileyProto(acc->szModuleName))
+ if (Proto_IsAccountEnabled(acc) && acc->szProtoName && IsSmileyProto(acc->szModuleName))
{
CMString displayName(acc->tszAccountName ? acc->tszAccountName : A2T_SM(acc->szModuleName));
CMString PhysProtoName, paths;
@@ -981,7 +981,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) PROTOCOLDESCRIPTOR **proto;
int protoCount = 0;
- CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&proto);
+ Proto_EnumProtocols(&protoCount, &proto);
for (int i = 0; i < protoCount; i++){
PROTOCOLDESCRIPTOR* pd = proto[i];
@@ -990,7 +990,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) }
PROTOACCOUNT **accList;
- ProtoEnumAccounts(&protoCount, &accList);
+ Proto_EnumAccounts(&protoCount, &accList);
for (int i = 0; i < protoCount; i++)
AddAccountAsCategory(accList[i], defaultFile);
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 10301d536c..1b7a45727f 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -92,7 +92,7 @@ extern HINSTANCE hInst; INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int bInitializing = 0, i, j, numProtocols;
- PROTOCOLDESCRIPTOR** pd;
+ PROTOACCOUNT **pd;
TCHAR pName[256] = {0};
char protoOption[256] = {0};
char protoName[256] = {0};
@@ -102,113 +102,113 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM TCHAR buf[512];
switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(optDlg);
- bInitializing = 1;
-
- ///Main enable switch
- CheckDlgButton(optDlg, IDC_OPT_OUT_MSG_APPROVE, _getOptB("ApproveOnMsgOut", defaultApproveOnMsgOut) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_IN_MSG_APPROVE, _getOptB("ApproveOnMsgIn", defaultApproveOnMsgIn) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG, _getOptB("DontReplySameMsg", defaultDontReplySameMsg) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_DONT_REPLY_MSG, _getOptB("DontReplyMsg", defaultDontReplyMsg) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED, _getOptB("HideUnverified", defaultHideUnverified) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_ADD_PERMANENTLY, _getOptB("AddPermanently", defaultAddPermanently) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_LOG_ACTIONS, _getOptB("LogActions", defaultLogActions) ? BST_CHECKED : BST_UNCHECKED);
-
- SetDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, _getOptS(buf, SIZEOF(buf), "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist));
- SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itot((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
- SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itot((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
- SetDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, _getOptS(buf, SIZEOF(buf), "DontReplyMsgWordlist", defaultDontReplyMsgWordlist));
-
- ///Individual protocols list
- ListView_SetExtendedListViewStyle(hProtocolsList, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
- lvc.mask = LVCF_WIDTH;
- lvc.cx = 120;
- ListView_InsertColumn(hProtocolsList, 0, &lvc);
- lvi.mask = LVIF_TEXT | LVIF_STATE;
- CallService(MS_PROTO_ENUMACCOUNTS, (LPARAM)&numProtocols, (WPARAM)&pd);
- for (i = 0, j = 0; i < numProtocols; i++)
- {
- lvi.iItem = i;
- _getMOptS(pName, 200*sizeof(TCHAR), pd[i]->szName, "AM_BaseProto", _T(""));
- if (mir_tstrcmp(pName, _T("ICQ")) != 0)
- continue;
- lvi.pszText = mir_a2u(pd[i]->szName);
- ListView_InsertItem(hProtocolsList, &lvi);
- memset(protoOption, 0, sizeof(protoOption));
- mir_strcat(protoOption, "proto_");
- mir_strcat(protoOption, pd[i]->szName);
- ListView_SetCheckState(hProtocolsList, j++, _getOptB(protoOption, 0));
- }
-
- bInitializing = 0;
- return TRUE;
-
- case WM_COMMAND:
- if (bInitializing)
- return FALSE;
- switch (LOWORD(wParam)) {
- case IDC_OPT_OUT_MSG_APPROVE:
- case IDC_OPT_IN_MSG_APPROVE:
- case IDC_OPT_DONT_REPLY_SAME_MSG:
- case IDC_OPT_DONT_REPLY_MSG:
- case IDC_OPT_ADD_PERMANENTLY:
- case IDC_OPT_HIDE_UNTIL_VERIFIED:
- case IDC_OPT_LOG_ACTIONS:
- if (HIWORD(wParam) != BN_CLICKED)
- return FALSE;
- break;
- case IDC_OPT_IN_MSG_APPROVE_WORDLIST:
- case IDC_OPT_MAX_MSG_CONTACT:
- case IDC_OPT_MAX_SAME_MSG:
- case IDC_OPT_DONT_REPLY_MSG_WORDLIST:
- if (HIWORD(wParam) != EN_CHANGE)
- return FALSE;
- break;
- }
- SendMessage(GetParent(optDlg), PSM_CHANGED, 0, 0);
+ case WM_INITDIALOG:
+ TranslateDialogDefault(optDlg);
+ bInitializing = 1;
+
+ ///Main enable switch
+ CheckDlgButton(optDlg, IDC_OPT_OUT_MSG_APPROVE, _getOptB("ApproveOnMsgOut", defaultApproveOnMsgOut) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_IN_MSG_APPROVE, _getOptB("ApproveOnMsgIn", defaultApproveOnMsgIn) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG, _getOptB("DontReplySameMsg", defaultDontReplySameMsg) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_DONT_REPLY_MSG, _getOptB("DontReplyMsg", defaultDontReplyMsg) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED, _getOptB("HideUnverified", defaultHideUnverified) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_ADD_PERMANENTLY, _getOptB("AddPermanently", defaultAddPermanently) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_LOG_ACTIONS, _getOptB("LogActions", defaultLogActions) ? BST_CHECKED : BST_UNCHECKED);
+
+ SetDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, _getOptS(buf, SIZEOF(buf), "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist));
+ SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itot((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
+ SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itot((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
+ SetDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, _getOptS(buf, SIZEOF(buf), "DontReplyMsgWordlist", defaultDontReplyMsgWordlist));
+
+ ///Individual protocols list
+ ListView_SetExtendedListViewStyle(hProtocolsList, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
+ lvc.mask = LVCF_WIDTH;
+ lvc.cx = 120;
+ ListView_InsertColumn(hProtocolsList, 0, &lvc);
+ lvi.mask = LVIF_TEXT | LVIF_STATE;
+ Proto_EnumAccounts(&numProtocols, &pd);
+ for (i = 0, j = 0; i < numProtocols; i++)
+ {
+ lvi.iItem = i;
+ _getMOptS(pName, 200*sizeof(TCHAR), pd[i]->szModuleName, "AM_BaseProto", _T(""));
+ if (mir_tstrcmp(pName, _T("ICQ")) != 0)
+ continue;
+ lvi.pszText = mir_a2u(pd[i]->szModuleName);
+ ListView_InsertItem(hProtocolsList, &lvi);
+ memset(protoOption, 0, sizeof(protoOption));
+ mir_strcat(protoOption, "proto_");
+ mir_strcat(protoOption, pd[i]->szModuleName);
+ ListView_SetCheckState(hProtocolsList, j++, _getOptB(protoOption, 0));
+ }
+
+ bInitializing = 0;
+ return TRUE;
+
+ case WM_COMMAND:
+ if (bInitializing)
+ return FALSE;
+ switch (LOWORD(wParam)) {
+ case IDC_OPT_OUT_MSG_APPROVE:
+ case IDC_OPT_IN_MSG_APPROVE:
+ case IDC_OPT_DONT_REPLY_SAME_MSG:
+ case IDC_OPT_DONT_REPLY_MSG:
+ case IDC_OPT_ADD_PERMANENTLY:
+ case IDC_OPT_HIDE_UNTIL_VERIFIED:
+ case IDC_OPT_LOG_ACTIONS:
+ if (HIWORD(wParam) != BN_CLICKED)
+ return FALSE;
break;
- case WM_NOTIFY:
- if (bInitializing)
+ case IDC_OPT_IN_MSG_APPROVE_WORDLIST:
+ case IDC_OPT_MAX_MSG_CONTACT:
+ case IDC_OPT_MAX_SAME_MSG:
+ case IDC_OPT_DONT_REPLY_MSG_WORDLIST:
+ if (HIWORD(wParam) != EN_CHANGE)
return FALSE;
- switch (LOWORD(wParam)) {
- case IDC_OPT_PROTOCOLS:
- if (
- ((LPNMHDR)lParam)->code == LVN_ITEMCHANGED &&
- ((LPNMLISTVIEW)lParam)->uChanged & LVIF_STATE &&
- (((LPNMLISTVIEW)lParam)->uOldState & LVIS_STATEIMAGEMASK) != \
- (((LPNMLISTVIEW)lParam)->uNewState & LVIS_STATEIMAGEMASK)
- )
- SendMessage(GetParent(optDlg), PSM_CHANGED, 0, 0);
- break;
- }
- switch (((NMHDR*)lParam)->code) {
- case PSN_APPLY:
- _setOptB("ApproveOnMsgOut", IsDlgButtonChecked(optDlg, IDC_OPT_OUT_MSG_APPROVE));
- _setOptB("ApproveOnMsgIn", IsDlgButtonChecked(optDlg, IDC_OPT_IN_MSG_APPROVE));
- _setOptB("DontReplySameMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG));
- _setOptB("DontReplyMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_MSG));
- _setOptB("AddPermanently", IsDlgButtonChecked(optDlg, IDC_OPT_ADD_PERMANENTLY));
- _setOptB("HideUnverified", IsDlgButtonChecked(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED));
- _setOptB("LogActions", IsDlgButtonChecked(optDlg, IDC_OPT_LOG_ACTIONS));
- _saveDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, "ApproveOnMsgInWordlist");
- _saveDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, "DontReplyMsgWordlist");
- _saveDlgItemInt(optDlg, IDC_OPT_MAX_MSG_CONTACT, "MaxMsgContactCountPerDay");
- _saveDlgItemInt(optDlg, IDC_OPT_MAX_SAME_MSG, "MaxSameMsgCountPerDay");
- numProtocols = ListView_GetItemCount(hProtocolsList);
- for (i = 0; i < numProtocols; i++) {
- ListView_GetItemText(hProtocolsList, i, 0, buf, SIZEOF(buf));
- //wcstombs(protoName, buf, SIZEOF(buf));
- memset(protoOption, 0, sizeof(protoOption));
- mir_strcat(protoOption, "proto_");
- mir_strcat(protoOption, mir_u2a(buf));
- _setOptB(protoOption, ListView_GetCheckState(hProtocolsList, i));
- }
- return TRUE;
- }
break;
- case WM_DESTROY:
+ }
+ SendMessage(GetParent(optDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_NOTIFY:
+ if (bInitializing)
+ return FALSE;
+
+ switch (LOWORD(wParam)) {
+ case IDC_OPT_PROTOCOLS:
+ if (
+ ((LPNMHDR)lParam)->code == LVN_ITEMCHANGED &&
+ ((LPNMLISTVIEW)lParam)->uChanged & LVIF_STATE &&
+ (((LPNMLISTVIEW)lParam)->uOldState & LVIS_STATEIMAGEMASK) != \
+ (((LPNMLISTVIEW)lParam)->uNewState & LVIS_STATEIMAGEMASK)
+ )
+ SendMessage(GetParent(optDlg), PSM_CHANGED, 0, 0);
break;
+ }
+ switch (((NMHDR*)lParam)->code) {
+ case PSN_APPLY:
+ _setOptB("ApproveOnMsgOut", IsDlgButtonChecked(optDlg, IDC_OPT_OUT_MSG_APPROVE));
+ _setOptB("ApproveOnMsgIn", IsDlgButtonChecked(optDlg, IDC_OPT_IN_MSG_APPROVE));
+ _setOptB("DontReplySameMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG));
+ _setOptB("DontReplyMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_MSG));
+ _setOptB("AddPermanently", IsDlgButtonChecked(optDlg, IDC_OPT_ADD_PERMANENTLY));
+ _setOptB("HideUnverified", IsDlgButtonChecked(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED));
+ _setOptB("LogActions", IsDlgButtonChecked(optDlg, IDC_OPT_LOG_ACTIONS));
+ _saveDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, "ApproveOnMsgInWordlist");
+ _saveDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, "DontReplyMsgWordlist");
+ _saveDlgItemInt(optDlg, IDC_OPT_MAX_MSG_CONTACT, "MaxMsgContactCountPerDay");
+ _saveDlgItemInt(optDlg, IDC_OPT_MAX_SAME_MSG, "MaxSameMsgCountPerDay");
+ numProtocols = ListView_GetItemCount(hProtocolsList);
+ for (i = 0; i < numProtocols; i++) {
+ ListView_GetItemText(hProtocolsList, i, 0, buf, SIZEOF(buf));
+ //wcstombs(protoName, buf, SIZEOF(buf));
+ memset(protoOption, 0, sizeof(protoOption));
+ mir_strcat(protoOption, "proto_");
+ mir_strcat(protoOption, mir_u2a(buf));
+ _setOptB(protoOption, ListView_GetCheckState(hProtocolsList, i));
+ }
+ return TRUE;
+ }
+ break;
}
return FALSE;
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index 08a79a64d9..bd6ea8f7dc 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -580,7 +580,7 @@ int CSModuleLoaded(WPARAM wParam, LPARAM lParam) int count;
PROTOACCOUNT** protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++)
if (IsSuitableProto(protos[i]))
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp index 2eb6dde172..370819a3f7 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -46,7 +46,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L PROTOACCOUNT** proto;
int protoCount = 0;
- ProtoEnumAccounts(&protoCount, &proto);
+ Proto_EnumAccounts(&protoCount, &proto);
if (protoCount <= 0)
{
DisableDialog(hwndDlg);
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 7dc9711bb0..2e1af36c2a 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -162,7 +162,7 @@ static void GetCurrentConnectionSettings() int count; PROTOACCOUNT** protos; - ProtoEnumAccounts(&count, &protos); + Proto_EnumAccounts(&count, &protos); for (int i = 0; i < count; i++) if (IsSuitableProto(protos[i])) @@ -836,7 +836,7 @@ static void CheckContinueslyFunction(void *) int count; PROTOACCOUNT** protos; - ProtoEnumAccounts(&count, &protos); + Proto_EnumAccounts(&count, &protos); for (int i = 0; i < count; i++) { if (!IsSuitableProto(protos[i])) @@ -876,7 +876,7 @@ static VOID CALLBACK CheckContinueslyTimer(HWND, UINT, UINT_PTR, DWORD) // =============== popup ====================== static TCHAR* GetHumanName(LPARAM lParam) { - PROTOACCOUNT *ProtoAccount = ProtoGetAccount((char*)lParam); + PROTOACCOUNT *ProtoAccount = Proto_GetAccount((char*)lParam); return (ProtoAccount != NULL) ? ProtoAccount->tszAccountName : TranslateT("Protocol"); } diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index a5ecb7c2fe..452ac6e691 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -60,7 +60,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam int count;
PROTOACCOUNT** protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (i = 0; i < count; i++) {
if (!IsSuitableProto(protos[i]))
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 19032f1316..ca7d35b838 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -39,7 +39,7 @@ static TSettingsList* GetCurrentProtoSettings() {
int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
TSettingsList *result = new TSettingsList(count, CompareSettings);
if (result == NULL)
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 25c0e0bffd..a3b6687216 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -237,7 +237,7 @@ int GetProfile( int profile, TSettingsList& arSettings ) // if count == 0, continue so the default profile will be returned PROTOACCOUNT** protos; - ProtoEnumAccounts( &count, &protos ); + Proto_EnumAccounts( &count, &protos ); for ( int i=0; i < count; i++ ) if ( IsSuitableProto( protos[i] )) diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index b126018a9a..155cc1e17b 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -290,14 +290,14 @@ static int OnOkToExit(WPARAM, LPARAM) // save last protocolstatus
int count;
PROTOACCOUNT** protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
PROTOACCOUNT *pa = protos[i];
if (!IsSuitableProto(pa))
continue;
- if (!ProtoGetAccount(pa->szModuleName))
+ if (!Proto_GetAccount(pa->szModuleName))
continue;
char lastName[128], lastMsg[128];
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index f0423a24cc..fa128665f6 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -135,7 +135,7 @@ static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps) int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (i = 0; i < count; i++) {
if (!IsSuitableProto(protos[i]))
@@ -216,7 +216,7 @@ INT_PTR SetStatusEx(WPARAM wParam, LPARAM) // set all status messages first
for (int i = 0; i < protoList->getCount(); i++) {
char *szProto = protoSettings[i]->szName;
- if (!ProtoGetAccount(szProto)) {
+ if (!Proto_GetAccount(szProto)) {
log_debugA("CommonStatus: %s is not loaded", szProto);
continue;
}
@@ -290,7 +290,7 @@ int GetProtoCount() {
int pCount = 0, count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++)
if (IsSuitableProto(accs[i]))
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index 8ca2b6fca7..e26d2749a4 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -148,16 +148,14 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) switch(msg)
{
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwnd);
- int n;
- PROTOACCOUNT **pppd;
- if(!ProtoEnumAccounts(&n, &pppd))
- for (int i = 0; i < n; ++i) {
- SendDlgItemMessageA(hwnd, (ProtoInList(pppd[i]->szModuleName) ? ID_USEDPROTO : ID_ALLPROTO), LB_ADDSTRING, 0, (LPARAM)pppd[i]->szModuleName);
- }
- }
+ TranslateDialogDefault(hwnd);
+ int n;
+ PROTOACCOUNT **pppd;
+ Proto_EnumAccounts(&n, &pppd);
+ for (int i = 0; i < n; ++i)
+ SendDlgItemMessageA(hwnd, (ProtoInList(pppd[i]->szModuleName) ? ID_USEDPROTO : ID_ALLPROTO), LB_ADDSTRING, 0, (LPARAM)pppd[i]->szModuleName);
return TRUE;
+
case WM_COMMAND:
switch(LOWORD(wParam))
{
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 5474b3bab3..8c67f36c0e 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -342,7 +342,7 @@ void CleanThread() std::list<std::string> protocols;
int count = 0;
PROTOACCOUNT **accounts;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
for(int i = 0; i < count; i++)
{
if(!strstr(accounts[i]->szModuleName, "MetaContacts") && !strstr(accounts[i]->szModuleName, "Weather")) //not real protocols
diff --git a/plugins/StopSpamPlus/src/opt_proto.cpp b/plugins/StopSpamPlus/src/opt_proto.cpp index 404f619eca..cd3f17909c 100644 --- a/plugins/StopSpamPlus/src/opt_proto.cpp +++ b/plugins/StopSpamPlus/src/opt_proto.cpp @@ -14,8 +14,6 @@ int IsProtoIM(const PROTOACCOUNT *pa) int FillTree(HWND hwnd)
{
ProtocolData *PD;
- int i, n;
- PROTOACCOUNT** pa;
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
@@ -24,11 +22,12 @@ int FillTree(HWND hwnd) TreeView_DeleteAllItems(hwnd);
- if (CallService(MS_PROTO_ENUMACCOUNTS, (LPARAM)&n, (WPARAM)&pa))
- return FALSE;
+ int n;
+ PROTOACCOUNT** pa;
+ Proto_EnumAccounts(&n, &pa);
- for (i = 0; i < n; i++) {
- if (IsAccountEnabled(pa[i])) {
+ for (int i = 0; i < n; i++) {
+ if (Proto_IsAccountEnabled(pa[i])) {
PD = (ProtocolData*)mir_alloc(sizeof(ProtocolData));
PD->RealName = pa[i]->szModuleName;
PD->enabled = IsProtoIM(pa[i]);
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index c0aea1f488..fa3c09ec13 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -112,7 +112,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa else
pd.lchIcon = LoadIconEx("window");
- PROTOACCOUNT *pa = ProtoGetAccount(pszProtoName);
+ PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_sntprintf(pd.lptzContactName, SIZEOF(pd.lptzContactName), _T("%s - %s"),
(pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
pcli->pfnGetContactDisplayName(hContact, 0));
diff --git a/plugins/TabSRMM/src/commonheaders.h b/plugins/TabSRMM/src/commonheaders.h index e66fa8fb24..2aa8eb0347 100644 --- a/plugins/TabSRMM/src/commonheaders.h +++ b/plugins/TabSRMM/src/commonheaders.h @@ -69,7 +69,6 @@ #include <m_fontservice.h>
#include <m_acc.h>
#include <m_chat_int.h>
-#include <m_protomod.h>
#include <m_hotkeys.h>
#include <m_genmenu.h>
#include <m_popup.h>
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 7b1583e0d4..6429432ee9 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -61,7 +61,7 @@ void CContactCache::initPhaseTwo() { m_szAccount = 0; if (cc->szProto) { - PROTOACCOUNT *acc = ProtoGetAccount(cc->szProto); + PROTOACCOUNT *acc = Proto_GetAccount(cc->szProto); if (acc && acc->tszAccountName) m_szAccount = acc->tszAccountName; } @@ -152,7 +152,7 @@ void CContactCache::updateMeta() m_hSub = db_mc_getSrmmSub(cc->contactID); m_szMetaProto = GetContactProto(m_hSub); m_wMetaStatus = (WORD)db_get_w(m_hSub, m_szMetaProto, "Status", ID_STATUS_OFFLINE); - PROTOACCOUNT *pa = ProtoGetAccount(m_szMetaProto); + PROTOACCOUNT *pa = Proto_GetAccount(m_szMetaProto); if (pa) m_szAccount = pa->tszAccountName; diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 402c169e67..e39e300218 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -694,7 +694,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro if (!PluginConfig.g_hMenuTrayUnread || hContact == 0 || szProto == NULL)
return 0;
- PROTOACCOUNT *acc = ProtoGetAccount(szProto);
+ PROTOACCOUNT *acc = Proto_GetAccount(szProto);
TCHAR *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0);
if (tszFinalProto == 0)
return 0;
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 950b90c482..6cd62d5a68 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -214,7 +214,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con if (hIcon == 0)
hIcon = Skin_LoadProtoIcon(szProto, wStatus);
- PROTOACCOUNT *acc = ProtoGetAccount(szProto);
+ PROTOACCOUNT *acc = Proto_GetAccount(szProto);
if (acc && acc->tszAccountName) {
mii.cbSize = sizeof(mii);
mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 9f58b47288..47a814109c 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -1966,7 +1966,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int i, count = 0;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (i = 0; i < count; i++) {
if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0) {
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 55eec69396..1423c9b7ba 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -70,16 +70,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->iIndent = opt.iTextIndent; pwd->iSidebarWidth = opt.iSidebarWidth; - if (ServiceExists(MS_PROTO_GETACCOUNT)) { - PROTOACCOUNT *pa = ProtoGetAccount(pwd->clcit.szProto); - if (pa) - mir_tstrcpy(pwd->swzTitle, pa->tszAccountName); - } + PROTOACCOUNT *pa = Proto_GetAccount(pwd->clcit.szProto); + if (pa) + mir_tstrcpy(pwd->swzTitle, pa->tszAccountName); if (mir_tstrlen(pwd->swzTitle) == 0) a2t(pwd->clcit.szProto, pwd->swzTitle, TITLE_TEXT_LEN); - if (CallService(MS_PROTO_ISACCOUNTLOCKED, 0, (LPARAM)pwd->clcit.szProto)) + if (Proto_IsAccountLocked(pwd->clcit.szProto)) mir_sntprintf(pwd->swzTitle, SIZEOF(pwd->swzTitle), TranslateT("%s (locked)"), pwd->swzTitle); // protocol status @@ -1467,7 +1465,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa int oldOrder = -1, iProtoCount = 0; PROTOACCOUNT **accs; - ProtoEnumAccounts(&iProtoCount, &accs); + Proto_EnumAccounts(&iProtoCount, &accs); for (int j = 0; j < iProtoCount; j++) { PROTOACCOUNT *pa = NULL; @@ -1484,7 +1482,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (opt.bHideOffline && wStatus == ID_STATUS_OFFLINE) continue; - if (!IsAccountEnabled(pa) || !IsTrayProto(pa->tszAccountName, (BOOL)wParam)) + if (!Proto_IsAccountEnabled(pa) || !IsTrayProto(pa->tszAccountName, (BOOL)wParam)) continue; if (dwItems & TRAYTIP_NUMCONTACTS) { @@ -1501,7 +1499,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa TCHAR swzProto[256]; mir_tstrcpy(swzProto, pa->tszAccountName); if (dwItems & TRAYTIP_LOCKSTATUS) - if (CallService(MS_PROTO_ISACCOUNTLOCKED, 0, (LPARAM)pa->szModuleName)) + if (Proto_IsAccountLocked(pa->szModuleName)) mir_sntprintf(swzProto, SIZEOF(swzProto), TranslateT("%s (locked)"), pa->tszAccountName); AddRow(pwd, swzProto, buff, NULL, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, wStatus)); diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 4830e729d7..15310e474d 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -265,12 +265,12 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff } } else if (!mir_tstrcmp(swzRawSpec, _T("account"))) { - char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0); + char *szProto = Proto_GetBaseAccountName(hContact); if ((INT_PTR)szProto == CALLSERVICE_NOTFOUND) { return GetSysSubstText(hContact, _T("proto"), buff, bufflen); } else if (szProto) { - PROTOACCOUNT *pa = ProtoGetAccount(szProto); + PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa && pa->tszAccountName) { _tcsncpy(buff, pa->tszAccountName, bufflen); return true; @@ -512,7 +512,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF if (*p) { char *cp = GetContactProto(hContact); if (cp != NULL) { - PROTOACCOUNT *acc = ProtoGetAccount(cp); + PROTOACCOUNT *acc = Proto_GetAccount(cp); if (acc != NULL) { cp = acc->szProtoName; } diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index c51b7da658..aec54e4156 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -680,7 +680,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP // enum protocols currently running
int iProtoCount = 0;
PROTOACCOUNT **ppProtos = 0;
- ProtoEnumAccounts(&iProtoCount, &ppProtos);
+ Proto_EnumAccounts(&iProtoCount, &ppProtos);
// and fill in the list
for (int i=0; i < iProtoCount; i++)
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 4ce4b7df3a..7c54e5f271 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -1172,7 +1172,7 @@ void CreateProtocolList(void) int i;
PROTOACCOUNT **acc;
//
- ProtoEnumAccounts(&NumberOfAccounts,&acc);
+ Proto_EnumAccounts(&NumberOfAccounts,&acc);
//
ProtoList = (PROTOLIST*)mir_alloc(sizeof(PROTOLIST)*(NumberOfAccounts));
//
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 3b166e29b0..c3a8cee0a6 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -473,7 +473,7 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto) SetFlags(MADF_HASCUSTOM);
}
// if pszProto is set to NULL, this will be scaned only incase the birthday date has not been found yet
- else if (pszProto || (pszProto = DB::Contact::Proto(hContact)) != NULL)
+ else if (pszProto || (pszProto = Proto_GetBaseAccountName(hContact)) != NULL)
{
// try to get birthday from basic protocol
if (!DBGetDate(hContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
@@ -728,7 +728,7 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo // A custom birthday was set by user before and is not to be ignored
if ((_wFlags & MADF_HASCUSTOM) && (bDontIgnoreAnything || !lastAnswer || (*lastAnswer != IDNONE))) {
if (!pszProto)
- pszProto = DB::Contact::Proto(hContact);
+ pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto) {
BYTE bIsMeta = DB::Module::IsMeta(pszProto);
@@ -772,7 +772,7 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo for (int i = 0; i < nSubContactCount; 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))
+ if (!mdbIgnore.DBGetDate(hSubContact, Proto_GetBaseAccountName(hSubContact), SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
mdbIgnore.DBWriteDateStamp(hSubContact, USERINFO, SET_REMIND_BIRTHDAY_IGNORED);
DBWriteBirthDate(hSubContact);
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 2231f7c157..f5d6d28d63 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -274,21 +274,21 @@ int CPsTreeItem::ItemLabel(const BYTE bReadDBValue) **/
HICON CPsTreeItem::ProtoIcon()
{
+ if (!_pszName)
+ return NULL;
+
PROTOACCOUNT **pa;
int ProtoCount;
- if (!ProtoEnumAccounts(&ProtoCount, &pa)) {
- if (_pszName) {
- for (int i = 0; i < ProtoCount; i++) {
- if (!mir_tcsnicmp(pa[i]->tszAccountName, _A2T(_pszName), mir_tstrlen(pa[i]->tszAccountName))) {
- CHAR szIconID[MAX_PATH];
- mir_snprintf(szIconID, SIZEOF(szIconID), "core_status_%s1", pa[i]->szModuleName);
- HICON hIco = IcoLib_GetIcon(szIconID);
- if (!hIco)
- hIco = (HICON)CallProtoService(pa[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL, NULL);
-
- return hIco;
- }
- }
+ Proto_EnumAccounts(&ProtoCount, &pa);
+ for (int i = 0; i < ProtoCount; i++) {
+ if (!mir_tcsnicmp(pa[i]->tszAccountName, _A2T(_pszName), mir_tstrlen(pa[i]->tszAccountName))) {
+ CHAR szIconID[MAX_PATH];
+ mir_snprintf(szIconID, SIZEOF(szIconID), "core_status_%s1", pa[i]->szModuleName);
+ HICON hIco = IcoLib_GetIcon(szIconID);
+ if (!hIco)
+ hIco = (HICON)CallProtoService(pa[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL, NULL);
+
+ return hIco;
}
}
return NULL;
diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h index d16a2d558f..d8df6855c7 100644 --- a/plugins/UserInfoEx/src/commonheaders.h +++ b/plugins/UserInfoEx/src/commonheaders.h @@ -56,7 +56,6 @@ using namespace std; #include <m_database.h>
#include <m_hotkeys.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_options.h>
#include <m_xml.h>
#include <m_timezones.h>
@@ -222,7 +221,7 @@ static FORCEINLINE BOOL IsProtoOnline(LPSTR pszProto) static FORCEINLINE BOOL IsProtoAccountEnabled(PROTOACCOUNT *pAcc)
{
- return (pAcc->bIsEnabled && ProtoGetAccount(pAcc->szModuleName));
+ return (pAcc->bIsEnabled && Proto_GetAccount(pAcc->szModuleName));
}
typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 2c698d806b..23ef5396dd 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -746,7 +746,7 @@ class CAnnivList // ignore meta subcontacts here, as they are not interesting.
if (!db_mc_isSub(hContact)) {
// filter protocol
- pszProto = DB::Contact::Proto(hContact);
+ pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto) {
numContacts++;
switch (GenderOf(hContact, pszProto)) {
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 0828884142..e43577998e 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -167,8 +167,7 @@ public: int UploadFirst()
{
// create a list of all protocols which support uploading contact information
- if ( ProtoEnumAccounts(&_numProto, &_pPd))
- return _bExitAfterUploading ? UPLOAD_FINISH_CLOSE : UPLOAD_FINISH;
+ Proto_EnumAccounts(&_numProto, &_pPd);
return UploadNext();
}
@@ -290,7 +289,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) }
else {
// get contact's protocol
- psh._pszPrefix = psh._pszProto = DB::Contact::Proto(wParam);
+ psh._pszPrefix = psh._pszProto = Proto_GetBaseAccountName(wParam);
if (psh._pszProto == NULL) {
MsgErr(NULL, LPGENT("Could not find contact's protocol. Maybe it is not active!"));
return 1;
@@ -317,7 +316,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) psh._hContact = db_mc_getSub(wParam, i);
psh._nSubContact = i;
if (psh._hContact) {
- psh._pszProto = DB::Contact::Proto(psh._hContact);
+ psh._pszProto = Proto_GetBaseAccountName(psh._hContact);
if ((INT_PTR)psh._pszProto != CALLSERVICE_NOTFOUND)
NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
}
@@ -561,28 +560,25 @@ void DlgContactInfoInitTreeIcons() // avoid pages from loading doubled
if (!(bInitIcons & INIT_ICONS_CONTACT)) {
- LPCSTR pszContactProto = NULL;
- PROTOACCOUNT **pd;
- int ProtoCount = 0;
-
psh._dwFlags |= PSF_PROTOPAGESONLY_INIT;
// enumerate all protocols
- if (!ProtoEnumAccounts(&ProtoCount, &pd)) {
- for (i = 0; i < ProtoCount; i++) {
- // enumerate all contacts
- for (psh._hContact = db_find_first(); psh._hContact != NULL; psh._hContact = db_find_next(psh._hContact)) {
- // compare contact's protocol to the current one, to add
- pszContactProto = DB::Contact::Proto(psh._hContact);
- if ((INT_PTR)pszContactProto != CALLSERVICE_NOTFOUND && !mir_strcmp(pd[i]->szModuleName, pszContactProto)) {
- // call a notification for the contact to retrieve all protocol specific tree items
- NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
- if (psh._pPages) {
- psh.Free_pPages();
- psh._dwFlags = PSTVF_INITICONS | PSF_PROTOPAGESONLY;
- }
- break;
+ PROTOACCOUNT **pd;
+ int ProtoCount = 0;
+ Proto_EnumAccounts(&ProtoCount, &pd);
+ for (i = 0; i < ProtoCount; i++) {
+ // enumerate all contacts
+ for (psh._hContact = db_find_first(); psh._hContact != NULL; psh._hContact = db_find_next(psh._hContact)) {
+ // compare contact's protocol to the current one, to add
+ LPCSTR pszContactProto = Proto_GetBaseAccountName(psh._hContact);
+ if ((INT_PTR)pszContactProto != CALLSERVICE_NOTFOUND && !mir_strcmp(pd[i]->szModuleName, pszContactProto)) {
+ // call a notification for the contact to retrieve all protocol specific tree items
+ NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
+ if (psh._pPages) {
+ psh.Free_pPages();
+ psh._dwFlags = PSTVF_INITICONS | PSF_PROTOPAGESONLY;
}
+ break;
}
}
}
@@ -637,10 +633,10 @@ void DlgContactInfoLoadModule() PROTOACCOUNT **pAcc;
int nAccCount;
- if (MIRSUCCEEDED(ProtoEnumAccounts(&nAccCount, &pAcc)))
- for (int i = 0; (i < nAccCount) && !myGlobals.CanChangeDetails; i++)
- if (IsProtoAccountEnabled(pAcc[i])) // update my contact information on icq server
- myGlobals.CanChangeDetails = MIREXISTS(CallProtoService(pAcc[i]->szModuleName, PS_CHANGEINFOEX, NULL, NULL));
+ Proto_EnumAccounts(&nAccCount, &pAcc);
+ for (int i = 0; (i < nAccCount) && !myGlobals.CanChangeDetails; i++)
+ if (IsProtoAccountEnabled(pAcc[i])) // update my contact information on icq server
+ myGlobals.CanChangeDetails = MIREXISTS(CallProtoService(pAcc[i]->szModuleName, PS_CHANGEINFOEX, NULL, NULL));
}
static void ResetUpdateInfo(LPPS pPs)
@@ -1554,7 +1550,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar for (int i = 0; i < numSubs; i++) {
MCONTACT hSubContact = db_mc_getSub(pPs->hContact, i);
if (hSubContact != NULL) {
- if (ProtoServiceExists(DB::Contact::Proto(hSubContact), PSS_GETINFO)) {
+ if (ProtoServiceExists(Proto_GetBaseAccountName(hSubContact), PSS_GETINFO)) {
pPs->infosUpdated = (TAckInfo *)mir_realloc(pPs->infosUpdated, sizeof(TAckInfo) * (pPs->nSubContacts + 1));
pPs->infosUpdated[pPs->nSubContacts].hContact = hSubContact;
pPs->infosUpdated[pPs->nSubContacts].acks = NULL;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index a85bff5d88..0951d07ace 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -94,7 +94,7 @@ BYTE CExImContactBase::fromDB(MCONTACT hContact) if (!_hContact) return TRUE; // Proto - if (!(pszProto = DB::Contact::Proto(_hContact))) return FALSE; + if (!(pszProto = Proto_GetBaseAccountName(_hContact))) return FALSE; _pszProto = mir_strdup(pszProto); // AM_BaseProto @@ -229,21 +229,19 @@ MCONTACT CExImContactBase::toDB() { // create new contact if none exists if (_hContact == INVALID_CONTACT_ID && _pszProto && _pszUIDKey && _dbvUID.type != DBVT_DELETED) { - PROTOACCOUNT* pszAccount = 0; - if (NULL == (pszAccount = ProtoGetAccount( _pszProto ))) { + PROTOACCOUNT *pszAccount = Proto_GetAccount(_pszProto); + if (pszAccount == NULL) { //account does not exist return _hContact = INVALID_CONTACT_ID; } - if (!IsAccountEnabled(pszAccount)) { - ; - } + // create new contact _hContact = DB::Contact::Add(); if (!_hContact) { return _hContact = INVALID_CONTACT_ID; } // Add the protocol to the new contact - if (CallService(MS_PROTO_ADDTOCONTACT, _hContact, (LPARAM)_pszProto)) { + if (Proto_AddToContact(_hContact, _pszProto)) { DB::Contact::Delete(_hContact); return _hContact = INVALID_CONTACT_ID; } @@ -484,7 +482,7 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact) if (!_pszProto) return hContact == NULL; // compare protocols - pszProto = DB::Contact::Proto(hContact); + pszProto = Proto_GetBaseAccountName(hContact); if (pszProto == NULL || (INT_PTR)pszProto == CALLSERVICE_NOTFOUND || mir_strcmp(pszProto, _pszProto)) return FALSE; diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 682110ae8a..374f296123 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -220,7 +220,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar name = (LPCTSTR) pDat->ExImContact->ptszName;
break;
case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = ProtoGetAccount(pDat->ExImContact->pszName);
+ PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
name = (LPCTSTR) acc->tszAccountName;
break;
}
@@ -240,7 +240,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar TreeView_SetItemHeight(hTree, 18);
pszProto = (pDat->ExImContact->Typ == EXIM_CONTACT && pDat->ExImContact->hContact != NULL)
- ? (LPSTR)DB::Contact::Proto(pDat->ExImContact->hContact)
+ ? (LPSTR)Proto_GetBaseAccountName(pDat->ExImContact->hContact)
: NULL;
// add items that are always exported
@@ -298,7 +298,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar {
// ignore empty modules
if (!DB::Module::IsEmpty(hContact, p)) {
- pszProto = DB::Contact::Proto(hContact);
+ pszProto = Proto_GetBaseAccountName(hContact);
// Filter by mode
switch (pDat->ExImContact->Typ)
{
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 8dff63f5d4..fb0a8ad16e 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -856,7 +856,7 @@ BYTE CVCardFileVCF::Open(MCONTACT hContact, LPCSTR pszFileName, LPCSTR pszMode) return FALSE;
if ((_hContact = hContact) == INVALID_CONTACT_ID)
return FALSE;
- if (!(_pszBaseProto = DB::Contact::Proto(_hContact)))
+ if (!(_pszBaseProto = Proto_GetBaseAccountName(_hContact)))
return FALSE;
return TRUE;
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 6f5158a941..b2a0a1676f 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -177,7 +177,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) break;
case EXIM_ACCOUNT:
// export only contact with selectet account name
- if (!mir_strncmp(ExImContact->pszName, DB::Contact::Proto(hContact), mir_strlen(ExImContact->pszName))) {
+ if (!mir_strncmp(ExImContact->pszName, Proto_GetBaseAccountName(hContact), mir_strlen(ExImContact->pszName))) {
if (vContact.fromDB(hContact)) {
vContact.Export(xmlfile, &Modules);
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index b67b99b966..3b7fea78fe 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -60,7 +60,7 @@ static void DisplayNameToFileName(lpExImParam ExImContact, LPSTR pszFileName, WO disp = temp;
break;
case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = ProtoGetAccount(ExImContact->pszName);
+ PROTOACCOUNT* acc = Proto_GetAccount(ExImContact->pszName);
temp = mir_t2a(acc->tszAccountName);
disp = temp;
break;
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index e54be73d85..17fd80aa2e 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -30,22 +30,6 @@ namespace DB { namespace Contact {
/**
-* This function is used to retrieve a contact's basic protocol
-* @param hContact - handle to the contact
-* @return This function returns the basic protocol of a contact.
-**/
-
-LPSTR Proto(MCONTACT hContact)
-{
- if (hContact) {
- INT_PTR result;
- result = CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, NULL);
- return (LPSTR) ((result == CALLSERVICE_NOTFOUND) ? NULL : result);
- }
- return NULL;
-}
-
-/**
* Gets the number of contacts in the database, which does not count the user
* @param hContact - handle to the contact
* @return Returns the number of contacts. They can be retrieved using
@@ -262,7 +246,7 @@ BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetti if (def > -1 && def < INT_MAX) {
hSubContact = db_mc_getSub(hContact, def);
if (hSubContact != NULL)
- result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0;
+ result = DB::Setting::GetEx(hSubContact, pszModule, Proto_GetBaseAccountName(hSubContact), pszSetting, dbv, destType) != 0;
}
// scan all subcontacts for the setting
if (result) {
@@ -273,7 +257,7 @@ BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetti if (i != def) {
hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL)
- result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0;
+ result = DB::Setting::GetEx(hSubContact, pszModule, Proto_GetBaseAccountName(hSubContact), pszSetting, dbv, destType) != 0;
} } } } } }
return result;
@@ -317,7 +301,7 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps if (def > -1 && def < INT_MAX) {
hSubContact = db_mc_getSub(hContact, def);
if (hSubContact != NULL) {
- wFlags = GetCtrl(hSubContact, pszSubModule, NULL, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType);
+ wFlags = GetCtrl(hSubContact, pszSubModule, NULL, Proto_GetBaseAccountName(hSubContact), pszSetting, dbv, destType);
if (wFlags != 0) {
wFlags &= ~CTRLF_HASCUSTOM;
wFlags |= CTRLF_HASMETA;
@@ -332,7 +316,7 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps if (i != def) {
hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL) {
- wFlags = GetCtrl(hSubContact, pszSubModule, NULL, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType);
+ wFlags = GetCtrl(hSubContact, pszSubModule, NULL, Proto_GetBaseAccountName(hSubContact), pszSetting, dbv, destType);
if (wFlags != 0) {
wFlags &= ~CTRLF_HASCUSTOM;
wFlags |= CTRLF_HASMETA;
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index adb8ef8927..6b83a4e3a5 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -32,8 +32,6 @@ namespace Contact { { return pcli->pfnGetContactDisplayName(hContact, 0);
}
- LPSTR Proto(MCONTACT hContact);
-
INT_PTR GetCount();
MCONTACT Add();
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 08b486726b..29ddc0cea9 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -543,7 +543,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam) mhRoot = pcli->menuProtos[i].pMenu;
if ( mhRoot == NULL )
break;
- pAccountName = ProtoGetAccount(pcli->menuProtos[i].szProto);
+ pAccountName = Proto_GetAccount(pcli->menuProtos[i].szProto);
// create service name main (account module name) and set pointer to end it
char text[ 200 ];
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index b65f24b7f9..9ce4fd36ee 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -1140,7 +1140,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR MCONTACT hSubContact, hDefContact;
LPCSTR pszSubBaseProto;
- if ((hDefContact = db_mc_getSub(hContact, iDefault)) && (pszSubBaseProto = DB::Contact::Proto(hDefContact))) {
+ if ((hDefContact = db_mc_getSub(hContact, iDefault)) && (pszSubBaseProto = Proto_GetBaseAccountName(hDefContact))) {
if ((numProtoItems += ProfileList_AddItemlistFromDB(pList, iItem, idList, nList, hDefContact, pszSubBaseProto, pFmt[i].szCatFmt, pFmt[i].szValFmt, CTRLF_HASMETA | CTRLF_HASPROTO)) < 0)
return FALSE;
@@ -1151,7 +1151,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR continue;
if (!(hSubContact = db_mc_getSub(hContact, j)))
continue;
- if (!(pszSubBaseProto = DB::Contact::Proto(hSubContact)))
+ if (!(pszSubBaseProto = Proto_GetBaseAccountName(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_contactinfo.cpp b/plugins/UserInfoEx/src/svc_contactinfo.cpp index 1219e9ec17..3c53c8e23e 100644 --- a/plugins/UserInfoEx/src/svc_contactinfo.cpp +++ b/plugins/UserInfoEx/src/svc_contactinfo.cpp @@ -343,7 +343,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam) CONTACTINFO *ci = (CONTACTINFO*) lParam;
INT_PTR result;
- if (ci && ci->cbSize == sizeof(CONTACTINFO) && (ci->szProto != NULL || (ci->szProto = DB::Contact::Proto(ci->hContact)) != NULL)) {
+ if (ci && ci->cbSize == sizeof(CONTACTINFO) && (ci->szProto != NULL || (ci->szProto = Proto_GetBaseAccountName(ci->hContact)) != NULL)) {
switch (ci->dwFlag & 0x7F) {
//
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 351e36c9f2..d5890f52e6 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -43,7 +43,7 @@ static LPSTR Get(MCONTACT hContact) {
// ignore owner
if (hContact != NULL) {
- LPCSTR pszProto = DB::Contact::Proto(hContact);
+ LPCSTR pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto != NULL) {
LPCSTR e[2][4] = {
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index c440d15f3a..71f0f5eee5 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -55,7 +55,7 @@ BYTE GenderOf(MCONTACT hContact, LPCSTR pszProto) BYTE GenderOf(MCONTACT hContact)
{
- return GenderOf(hContact, DB::Contact::Proto(hContact));
+ return GenderOf(hContact, Proto_GetBaseAccountName(hContact));
}
/***********************************************************************************************************
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index 33b847f650..e1dede08d9 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -43,7 +43,7 @@ static LPSTR Get(MCONTACT hContact) {
// ignore owner
if (hContact != NULL) {
- LPCSTR pszProto = DB::Contact::Proto(hContact);
+ LPCSTR pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto != NULL) {
LPCSTR e[2] = { SET_CONTACT_HOMEPAGE, SET_CONTACT_COMPANY_HOMEPAGE };
for (int i = 0; i < 2; i++) {
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp index 130976526b..d236757f2c 100644 --- a/plugins/UserInfoEx/src/svc_phone.cpp +++ b/plugins/UserInfoEx/src/svc_phone.cpp @@ -53,7 +53,7 @@ static INT_PTR Get(MCONTACT hContact) // ignore owner
if (hContact != NULL) {
- LPCSTR pszProto = DB::Contact::Proto(hContact);
+ LPCSTR pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto != NULL) {
LPCSTR e[2][4] = {
{ SET_CONTACT_CELLULAR, SET_CONTACT_PHONE, "MyPhone0" },
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index ddf2672909..6a99a2ac44 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -629,7 +629,7 @@ class CContactUpdater : public CContactQueue **/
virtual void Callback(MCONTACT hContact, PVOID param)
{
- LPSTR pszProto = DB::Contact::Proto(hContact);
+ LPSTR pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto && pszProto[0])
{
@@ -689,7 +689,7 @@ public: **/
BOOL QueueAddRefreshContact(MCONTACT hContact, int iWait)
{
- LPSTR pszProto = DB::Contact::Proto(hContact);
+ LPSTR pszProto = Proto_GetBaseAccountName(hContact);
if ((mir_strcmp(pszProto, "Weather") != 0) && (mir_strcmp(pszProto, META_PROTO) != 0) && IsProtoOnline(pszProto))
return Add(iWait, hContact);
@@ -763,17 +763,14 @@ static CContactUpdater *ContactUpdater = NULL; **/
static BOOL IsMirandaOnline()
{
- PROTOACCOUNT **pAcc;
- int i, nAccCount;
BOOL bIsOnline = FALSE;
+ PROTOACCOUNT **pAcc;
+ int nAccCount;
+ Proto_EnumAccounts(&nAccCount, &pAcc);
+
+ for (int i = 0; (i < nAccCount) && !bIsOnline; i++)
+ bIsOnline |= (IsProtoAccountEnabled(pAcc[i]) && IsProtoOnline(pAcc[i]->szModuleName));
- if (MIRSUCCEEDED(ProtoEnumAccounts(&nAccCount, &pAcc)))
- {
- for (i = 0; (i < nAccCount) && !bIsOnline; i++)
- {
- bIsOnline |= (IsProtoAccountEnabled(pAcc[i]) && IsProtoOnline(pAcc[i]->szModuleName));
- }
- }
return bIsOnline;
}
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.cpp b/plugins/UserInfoEx/src/svc_timezone_old.cpp index 4056bcb15b..b859507240 100644 --- a/plugins/UserInfoEx/src/svc_timezone_old.cpp +++ b/plugins/UserInfoEx/src/svc_timezone_old.cpp @@ -412,7 +412,7 @@ CTimeZone* GetContactTimeZone(MCONTACT hContact, LPCSTR pszProto) CTimeZone* GetContactTimeZone(MCONTACT hContact)
{
- return GetContactTimeZone(hContact, DB::Contact::Proto(hContact));
+ return GetContactTimeZone(hContact, Proto_GetBaseAccountName(hContact));
}
/**
@@ -531,13 +531,13 @@ void SvcTimezoneSyncWithWindows() PROTOACCOUNT **pAcc;
int nAccCount;
- if (MIRSUCCEEDED(ProtoEnumAccounts(&nAccCount, &pAcc))) {
- for (int i = 0; i < nAccCount; i++) {
- // update local timezone as database setting
- if (IsProtoAccountEnabled(pAcc[i]) && SvcTimezoneSyncWithWindowsProc(pAcc[i]->szModuleName, tzi.Bias))
- // update my contact information on icq server
- CallProtoService(pAcc[i]->szModuleName, PS_CHANGEINFOEX, CIXT_LOCATION, NULL);
- }
+ Proto_EnumAccounts(&nAccCount, &pAcc);
+
+ for (int i = 0; i < nAccCount; i++) {
+ // update local timezone as database setting
+ if (IsProtoAccountEnabled(pAcc[i]) && SvcTimezoneSyncWithWindowsProc(pAcc[i]->szModuleName, tzi.Bias))
+ // update my contact information on icq server
+ CallProtoService(pAcc[i]->szModuleName, PS_CHANGEINFOEX, CIXT_LOCATION, NULL);
}
}
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index 78c68501ee..15bb6d61a7 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -9,7 +9,6 @@ uses //----- Contact info -----
-function GetContactProtoAcc(hContact:TMCONTACT):PAnsiChar;
function GetContactProto(hContact: TMCONTACT): PAnsiChar; overload;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar; overload;
function GetContactDisplayName(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PWideChar;
@@ -63,27 +62,19 @@ uses //----- Contact info -----
-function GetContactProtoAcc(hContact:TMCONTACT):PAnsiChar;
-begin
- if ServiceExists(MS_PROTO_GETCONTACTBASEACCOUNT)<>0 then
- result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEACCOUNT,hContact,0))
- else
- result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0));
-end;
-
function GetContactProto(hContact: TMCONTACT): PAnsiChar;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
- Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ Result := Proto_GetProtoName(hContact);
end;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar;
begin
- Result := GetContactProto(hContact);
+ Result := Proto_GetProtoName(hContact);
if StrCmp(Result, META_PROTO)=0 then
begin
SubContact := CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
- SubProtocol := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, SubContact, 0));
+ SubProtocol := Proto_GetProtoName(SubContact);
end
else
begin
@@ -246,7 +237,7 @@ begin begin
result:=0;
- p:=PPROTOACCOUNT(CallService(MS_PROTO_GETACCOUNT,0,lparam(@name)));
+ p:=Proto_GetAccount(@name);
if p=nil then
result:=-2 // deleted
else if (not p^.bIsEnabled) or p^.bDynDisabled then
@@ -371,7 +362,7 @@ var is_chat:boolean;
begin
result:=0;
- Proto:=GetContactProtoAcc(hContact);
+ Proto:=Proto_GetBaseAccountName(hContact);
if Proto<>nil then
begin
p:=StrCopyE(section,setting);
@@ -593,7 +584,7 @@ begin if lAccount then
begin
- acc:=GetContactProtoAcc(hContact);
+ acc:=Proto_GetBaseAccountName(hContact);
StrReplaceW(buf,'%account%',FastAnsiToWideBuf(acc,buf1));
end
else
@@ -602,7 +593,7 @@ begin if lUID then
begin
if acc=nil then
- acc:=GetContactProtoAcc(hContact);
+ acc:=Proto_GetBaseAccountName(hContact);
if IsChat(hContact) then
begin
p:=DBReadUnicode(hContact,acc,'ChatRoomID');
diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas index e1e7f3786b..08b9221711 100644 --- a/plugins/Utils.pas/protocols.pas +++ b/plugins/Utils.pas/protocols.pas @@ -411,7 +411,7 @@ var p:pAnsichar;
// hContract:THANDLE;
begin
- CallService(MS_PROTO_ENUMACCOUNTS,wparam(@protoCount),lparam(@proto));
+ Proto_EnumAccounts(protoCount, proto);
mGetMem(protos,(protoCount+1)*SizeOf(tMyProto)); // 0 - default
NumProto:=0;
diff --git a/plugins/Utils.pas/srvblock.pas b/plugins/Utils.pas/srvblock.pas index 5ceb7a8fed..cf7b4125eb 100644 --- a/plugins/Utils.pas/srvblock.pas +++ b/plugins/Utils.pas/srvblock.pas @@ -562,7 +562,7 @@ begin if StrPos(buf,protostr)<>nil then
if CallService(MS_DB_CONTACT_IS,data.Parameter,0)<>0 then
- StrReplace(buf,protostr,GetContactProtoAcc(data.Parameter))
+ StrReplace(buf,protostr,Proto_GetBaseAccountName(data.Parameter))
else
Exit;
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index a90cf77148..9618b51c4f 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -210,7 +210,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
PROTOACCOUNT *p = protos[i];
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 38b9a6296b..0c8a0642e7 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -120,7 +120,7 @@ TCHAR* getContactInfoT(BYTE type, MCONTACT hContact) return mir_a2t(szProto);
case CCNF_ACCOUNT: {
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
return pa ? mir_tstrdup(pa->tszAccountName) : NULL;
}
diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas index e26ce14f17..625e4fa031 100644 --- a/plugins/Watrack/proto/proto.pas +++ b/plugins/Watrack/proto/proto.pas @@ -84,129 +84,6 @@ begin db_event_add(hContact, @dbeo);
end;
-{SEND-time text translation}
-(*
-const
- BufSize = 16384;
-
-function FormatToBBW(src:PWideChar):PWideChar;
-var
- buf:array [0..32] of WideChar;
- p:PWideChar;
- i,j:integer;
-begin
- result:=src;
- StrReplaceW(src,'{b}' ,'[b]');
- StrReplaceW(src,'{/b}' ,'[/b]');
- StrReplaceW(src,'{u}' ,'[u]');
- StrReplaceW(src,'{/u}' ,'[/u]');
- StrReplaceW(src,'{i}' ,'[i]');
- StrReplaceW(src,'{/i}' ,'[/i]');
- StrReplaceW(src,'{/cf}','[/color]');
- StrReplaceW(src,'{/bg}','');
- StrCopyW(buf,'[color=');
- repeat
- i:=StrPosW(src,'{cf');
- if i=0 then break;
- j:=i;
- dec(i);
- while (src[j]<>#0) and (src[j]<>'}') do inc(j);
- if src[j]='}' then inc(j);
- case StrToInt(src+i+3) of
- 4,10: p:='green]';
- 5,6: p:='red]';
- 7,14: p:='magenta]';
- 3,11,
- 12,13: p:='blue]';
- 8,9: p:='yellow]';
- 2,15: p:='black]';
- else
- {1,16:} p:='white]';
- end;
- StrCopyW(buf+7,p);
- StrCopyW(src+i,src+j);
- StrInsertW(buf,src,i);
- until false;
- repeat
- i:=StrIndex(src,'{bg');
- if i=0 then break;
- j:=i;
- dec(i);
- while (src[j]<>#0) and (src[j]<>'}') do inc(j);
- if src[j]='}' then inc(j);
- StrCopyW(src+i,src+j);
- until false;
-end;
-
-function SendMessageProcW(wParam:WPARAM; lParam:LPARAM):integer; cdecl;
-var
- ccs:PCCSDATA;
- uns,s,ss:pWideChar;
- p:PAnsiChar;
- present:boolean;
- i:integer;
-begin
- if DisablePlugin<>dsPermanent then
- begin
- ccs:=PCCSDATA(lParam);
- if ccs^.wParam=0 then
- present:=StrPos('%music%',PAnsiChar(ccs^.lParam))<>nil
- else // not needed?
- begin
- uns:=PWideChar(ccs^.lParam+StrLen(PAnsiChar(ccs^.lParam))+1);
- present:=StrPos(uns,'%music%')<>nil;
- end;
-
- if present then
- begin
- if CallService(MS_WAT_GETMUSICINFO,0,0)=WAT_RES_NOTFOUND then
- s:=nil
- else
- begin
- if SimpleMode<>BST_UNCHECKED then
- i:=0
- else
- i:=CallService(MS_PROTO_GETCONTACTBASEPROTO,ccs^.hContact,0);
- s:=GetMacros(TM_MESSAGE,i);
- end;
- // if s<>nil then // for empty strings
- begin
- mGetMem(ss,BufSize*SizeOf(pWideChar));
- FillChar(ss^,BufSize*SizeOf(pWideChar),0);
- if ccs^.wParam=0 then
- AnsiToWide(PAnsiChar(ccs^.lParam),uns,UserCP);
- StrCopyW(ss,uns);
- if ccs^.wParam=0 then
- mFreeMem(uns);
- StrReplaceW(ss,'%music%',s);
- mFreeMem(s);
- if StrPos(ss,'{')<>nil then
- FormatToBBW(ss);
- s:=PWideChar(ccs^.lParam);
- WideToAnsi(ss,p,UserCP);
- if ccs^.wParam=0 then
- begin
- ccs^.lParam:=tlparam(p);
- end
- else
- begin
- move(PAnsiChar(ss)^,(PAnsiChar(ss)+StrLen(p)+1)^,
- (StrLenW(ss)+1)*SizeOf(WideChar));
- StrCopy(PAnsiChar(ss),p);
- ccs^.lParam:=tlparam(ss);
- end;
- result:=CallService(MS_PROTO_CHAINSEND,wParam,lParam);
- mFreeMem(p);
- ccs^.lParam:=tlparam(s);
- mFreeMem(ss);
- exit;
- end;
- end;
- end;
- result:=CallService(MS_PROTO_CHAINSEND,wParam,lParam);
-end;
-*)
-
function ReceiveMessageProcW(wParam:WPARAM; lParam:LPARAM):int_ptr; cdecl;
const
bufsize = 4096*SizeOf(WideChar);
@@ -237,13 +114,13 @@ begin (StrCmp(PPROTORECVEVENT(ccs^.lParam)^.szMessage.a,
wpRequest,Length(wpRequest))=0) then
begin
- StrCopy(PAnsiChar(buf),PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,ccs^.hContact,0)));
+ StrCopy(PAnsiChar(buf),Proto_GetProtoName(ccs^.hContact));
i:=DBReadWord(ccs^.hContact,PAnsiChar(buf),'ApparentMode');
StrCat(PAnsiChar(buf),PS_GETSTATUS);
if (i=ID_STATUS_OFFLINE) or
((i=0) and (CallService(PAnsiChar(buf),0,0)=ID_STATUS_INVISIBLE)) then
begin
- result:=CallService(MS_PROTO_CHAINRECV,wParam,lParam);
+ result:=Proto_ChainRecv(wParam,ccs);
end
else if DBReadByte(ccs^.hContact,strCList,ShareOptText,0)<>0 then
// or (NotListedAllow and (DBReadByte(ccs^.hContact,strCList,'NotOnList',0))
@@ -385,7 +262,7 @@ begin Translate('You Get Error'),MB_ICONERROR);
end
else
- result:=CallService(MS_PROTO_CHAINRECV,wParam,lParam);
+ result:=Proto_ChainRecv(wParam,ccs);
mFreeMem(buf);
end;
@@ -409,7 +286,7 @@ begin while hContact<>0 do
begin
if not IsChat(hContact) then
- CallService(MS_PROTO_ADDTOCONTACT,hContact,lparam(PluginShort));
+ Proto_AddToContact(hContact,PluginShort);
hContact:=db_find_next(hContact);
end;
end;
@@ -418,7 +295,7 @@ function HookAddUser(hContact:WPARAM;lParam:LPARAM):int; cdecl; begin
result:=0;
if not IsChat(hContact) then
- CallService(MS_PROTO_ADDTOCONTACT,hContact,tlparam(PluginShort));
+ Proto_AddToContact(hContact,PluginShort);
end;
function OnContactMenu(hContact:WPARAM;lParam:LPARAM):int;cdecl;
@@ -442,12 +319,9 @@ begin desc.cbSize:=PROTOCOLDESCRIPTOR_V3_SIZE;//SizeOf(desc);
desc.szName:=PluginShort;
desc._type :=PROTOTYPE_TRANSLATION;
+ Proto_RegisterModule(@desc);
- CallService(MS_PROTO_REGISTERMODULE,0,lparam(@desc));
-// CreateProtoServiceFunction(PluginShort,PSS_MESSAGE ,@SendMessageProcW);
-// CreateProtoServiceFunction(PluginShort,PSS_MESSAGEW,@SendMessageProcW);
hSRM:=CreateProtoServiceFunction(PluginShort,PSR_MESSAGE ,@ReceiveMessageProcW);
-// CreateProtoServiceFunction(PluginShort,PSR_MESSAGEW,@ReceiveMessageProcW);
end;
function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
diff --git a/plugins/Watrack/status/i_hotkey.inc b/plugins/Watrack/status/i_hotkey.inc index 115be86655..e8f6ac3ea6 100644 --- a/plugins/Watrack/status/i_hotkey.inc +++ b/plugins/Watrack/status/i_hotkey.inc @@ -20,10 +20,8 @@ begin CurWin:=GetFocus;
if CurWin<>0 then
begin
-// j:=WndToContact(WaitFocusedWndChild(GetForegroundwindow){GetFocus});
j:=WndToContact(CurWin);
- p:=GetContactProtoAcc(j);
-// p:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,j,0));
+ p:=Proto_GetBaseAccountName(j);
if DBReadByte(j,p,'ChatRoom',0)=1 then
begin
isUnicode:=false;
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 02e61c82d2..ed3196c1e5 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -218,7 +218,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.cbSize = sizeof(pd);
pd.szName = WEATHERPROTONAME;
pd.type = (opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// initialize weather protocol services
InitServices();
diff --git a/plugins/Weather/src/weather.h b/plugins/Weather/src/weather.h index 182fb07cd9..6dfcb98e11 100644 --- a/plugins/Weather/src/weather.h +++ b/plugins/Weather/src/weather.h @@ -34,13 +34,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <malloc.h>
#include <newpluginapi.h>
-#include <m_protomod.h>
#include <m_icolib.h>
#include <m_options.h>
#include <m_langpack.h>
#include <m_skin.h>
#include <m_database.h>
#include <m_history.h>
+#include <m_protosvc.h>
#include <m_userinfo.h>
#include <m_netlib.h>
#include <m_ignore.h>
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index ea5f444fdc..878b590c65 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -64,7 +64,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) // if contact with the same ID was not found, add it
if (psr->cbSize < sizeof(PROTOSEARCHRESULT)) return 0;
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)WEATHERPROTONAME);
+ Proto_AddToContact(hContact, WEATHERPROTONAME);
// suppress online notification for the new contact
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index a9981b30fe..3df115a69a 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -158,7 +158,7 @@ extern "C" int __declspec(dllexport) Load() pd.cbSize = sizeof(pd);
pd.szName = MODULENAME;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
//protocol services
InitServices();
diff --git a/plugins/WebView/src/stdafx.h b/plugins/WebView/src/stdafx.h index 6bf059e385..fbd7b84666 100644 --- a/plugins/WebView/src/stdafx.h +++ b/plugins/WebView/src/stdafx.h @@ -21,7 +21,6 @@ #include <m_clistint.h>
#include <m_clui.h>
#include <m_database.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_protosvc.h>
#include <m_button.h>
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 7f6c29897c..20196b0fd1 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -369,7 +369,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) } hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODULENAME); + Proto_AddToContact(hContact, MODULENAME); /////////write to db db_set_b(hContact, MODULENAME, ON_TOP_KEY, 0); diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 8808b4b7b0..8e9f057066 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -591,7 +591,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, age--;
char *szProto = GetContactProto(hContact);
- PROTOACCOUNT *pAcc = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pAcc = Proto_GetAccount(szProto);
TCHAR *ptszAccName = (pAcc == NULL) ? TranslateT("Unknown") : pAcc->tszAccountName;
LVITEM item = { 0 };
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp index 0de3c7c0c1..4a7ca4de9b 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp +++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp @@ -23,7 +23,7 @@ void SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, MCONTACT return;
// check if we just connected, and want to suppress status changes
- if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) && m_protocol_info.isDisabled((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)user, 0)))
+ if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) && m_protocol_info.isDisabled(GetContactProto(user)))
return;
bool speak = false;
diff --git a/plugins/WinterSpeak/src/SpeakConfig.cpp b/plugins/WinterSpeak/src/SpeakConfig.cpp index 20b86b05f2..11b7d249b6 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.cpp +++ b/plugins/WinterSpeak/src/SpeakConfig.cpp @@ -50,40 +50,39 @@ bool SpeakConfig::say(const std::wstring &sentence, MCONTACT user, bool message) if (NULL != user)
{
// get the status of the protocol of this user
- const char *protocol = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)user, 0);
-
- switch (CallProtoService(protocol, PS_GETSTATUS, 0, 0))
- {
- case ID_STATUS_ONLINE:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online);
- break;
- case ID_STATUS_AWAY:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Away);
- break;
- case ID_STATUS_DND:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd);
- break;
- case ID_STATUS_NA:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na);
- break;
- case ID_STATUS_OCCUPIED:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied);
- break;
- case ID_STATUS_FREECHAT:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat);
- break;
- case ID_STATUS_INVISIBLE:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible);
- break;
- case ID_STATUS_OFFLINE:
- // if we are offline for this protocol, then don't speak the
- // sentence this is so we don't announce users offline status if
- // we are disconnected.
- active = false;
- break;
- default:
- active = false;
- break;
+ const char *protocol = GetContactProto(user);
+
+ switch (CallProtoService(protocol, PS_GETSTATUS, 0, 0)) {
+ case ID_STATUS_ONLINE:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online);
+ break;
+ case ID_STATUS_AWAY:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Away);
+ break;
+ case ID_STATUS_DND:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd);
+ break;
+ case ID_STATUS_NA:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na);
+ break;
+ case ID_STATUS_OCCUPIED:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied);
+ break;
+ case ID_STATUS_FREECHAT:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat);
+ break;
+ case ID_STATUS_INVISIBLE:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible);
+ break;
+ case ID_STATUS_OFFLINE:
+ // if we are offline for this protocol, then don't speak the
+ // sentence this is so we don't announce users offline status if
+ // we are disconnected.
+ active = false;
+ break;
+ default:
+ active = false;
+ break;
}
// if its a user say, then check the users status
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 00a777b36b..00bb9d704f 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -20,7 +20,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP WindowList_Add(hChangeSoundDlgList, hwndDlg, hContact);
Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, SETTINGSNAME, "ChangeSoundDlg");
char* szProto = GetContactProto(hContact);
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
char* szUniqueId = (char*)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = { 0 };
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index d85991de2e..8e414f6a24 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -30,7 +30,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TranslateDialogDefault(hwndDlg);
int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++)
if (IsSuitableProto(protos[i]))
SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_ADDSTRING, 0, (LPARAM)protos[i]->tszAccountName), (LPARAM)protos[i]);
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index a6fecdae02..e54db97808 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -69,7 +69,7 @@ void InitSelfSounds() int protoCount = 0;
PROTOACCOUNT** protos = 0;
- ProtoEnumAccounts(&protoCount, &protos);
+ Proto_EnumAccounts(&protoCount, &protos);
for (int i = 0; i < protoCount; i++) {
for (int j = 0; j < SIZEOF(selfSounds); j++) {
char namebuf[128];
@@ -193,7 +193,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM) MCONTACT hContact = wParam;
if (hContact) {
char *szProto = GetContactProto(hContact);
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
Menu_ShowItem(hChangeSound, IsSuitableProto(pa));
}
return 0;
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 4a2a341cfc..0f5b14e4f1 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -286,7 +286,7 @@ extern "C" int __declspec(dllexport) Load(void) PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; pd.szName = YAMN_DBMODULE; pd.type = PROTOTYPE_VIRTUAL; - CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); + Proto_RegisterModule(&pd); InitializeCriticalSection(&AccountStatusCS); InitializeCriticalSection(&FileWritingCS); diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index a8f458ebd7..90d9cd5fbf 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -303,7 +303,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) if (!Finder->hContact && (Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) {
//No account contact found, have to create one
Finder->hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, Finder->hContact, (LPARAM)YAMN_DBMODULE);
+ Proto_AddToContact(Finder->hContact, YAMN_DBMODULE);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Id", Finder->Name);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Nick", Finder->Name);
db_set_s(Finder->hContact, "Protocol", "p", YAMN_DBMODULE);
diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp index 209e26ce5f..812dfd7e41 100644 --- a/plugins/YAMN/src/services.cpp +++ b/plugins/YAMN/src/services.cpp @@ -484,7 +484,7 @@ void RefreshContact(void) }
else if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) {
Finder->hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)Finder->hContact, (LPARAM)YAMN_DBMODULE);
+ Proto_AddToContact(Finder->hContact, YAMN_DBMODULE);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Id", Finder->Name);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Nick", Finder->Name);
db_set_s(Finder->hContact, "Protocol", "p", YAMN_DBMODULE);
diff --git a/plugins/YAMN/src/yamn.h b/plugins/YAMN/src/yamn.h index 5e3f80b0f9..29955fcc7c 100644 --- a/plugins/YAMN/src/yamn.h +++ b/plugins/YAMN/src/yamn.h @@ -16,7 +16,7 @@ #include <m_clist.h>
#include <m_options.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_icolib.h>
#include <m_popup.h>
#include <m_messages.h>
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index 09e18df031..aca9c5de92 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -135,7 +135,7 @@ static int ProtoAck(WPARAM wParam, LPARAM lParam) if ( ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS ) {
long status = 0;
int count;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i=0; i < count; i++)
status = status | Proto_Status2Flag(CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0));
diff --git a/plugins/helpers/commonheaders.h b/plugins/helpers/commonheaders.h index 9c4e656ae6..e193175670 100644 --- a/plugins/helpers/commonheaders.h +++ b/plugins/helpers/commonheaders.h @@ -47,7 +47,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_netlib.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_utils.h>
diff --git a/plugins/mRadio/i_myservice.inc b/plugins/mRadio/i_myservice.inc index 3aa403398d..88ae278633 100644 --- a/plugins/mRadio/i_myservice.inc +++ b/plugins/mRadio/i_myservice.inc @@ -13,7 +13,7 @@ begin begin
if wParam=0 then
wParam:=GetCListSelContact;
- p:=GetContactProtoAcc(wParam);
+ p:=Proto_GetBaseAccountName(wParam);
if (p=nil) or (StrCmp(p,PluginName)<>0) then
exit;
hContact:=wParam;
@@ -161,7 +161,7 @@ begin result:=CallService(MS_DB_CONTACT_ADD,0,0);
if result<>0 then
begin
- CallService(MS_PROTO_ADDTOCONTACT,result,lparam(PluginName));
+ Proto_AddToContact(result,PluginName);
DBWriteString(result,PluginName,optStationURL,pc);
DBWriteString(result,PluginName,optFirstName ,pc);
@@ -297,7 +297,7 @@ begin result:=CallService(MS_DB_CONTACT_ADD,0,0);
if result<>0 then
begin
- CallService(MS_PROTO_ADDTOCONTACT,result,tlparam(PluginName));
+ Proto_AddToContact(result,PluginName);
//
// DBWriteByte(result,strCList,'Hidden' ,0);
DBWriteByte(result,strCList,'NotOnList',1);
diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index 52df888dd8..3b13dffae6 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -682,8 +682,7 @@ begin begin
if value._type=DBVT_DELETED then
begin
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0)),
- PluginName)<>0 then exit;
+ if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
pc:=DBReadString(wParam,PluginName,optNick);
DBWriteString(wParam,strCList,optMyHandle,pc);
@@ -697,8 +696,7 @@ begin if StrCmp(szSetting,optAge)=0 then
begin
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0)),
- PluginName)<>0 then exit;
+ if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
if value._type=DBVT_DELETED then
i:=DBReadWord(wParam,PluginName,optAge)
else
@@ -712,8 +710,7 @@ begin DBVT_ASCIIZ ,
DBVT_WCHAR ,
DBVT_UTF8 :
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0)),
- PluginName)<>0 then exit;
+ if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
else
exit;
end;
@@ -739,8 +736,4 @@ begin result:=0;
if ActiveContact<>THANDLE(wParam) then exit;
ControlCenter(MRC_STOP,wParam);
-
-{ if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0)),
- PluginName)<>0 then exit;
-}
end;
diff --git a/plugins/mRadio/i_search.inc b/plugins/mRadio/i_search.inc index 81e1a00eca..d6e65e4794 100644 --- a/plugins/mRadio/i_search.inc +++ b/plugins/mRadio/i_search.inc @@ -400,7 +400,7 @@ begin hContact:=CallService(MS_DB_CONTACT_ADD,0,0);
if hContact<>0 then
begin
- CallService(MS_PROTO_ADDTOCONTACT,hContact,tlparam(PluginName));
+ Proto_AddToContact(hContact,PluginName);
// URL
DBWriteUnicode(hContact,PluginName,optStationURL,lurl);
DBWriteUnicode(hContact,PluginName,optFirstName ,lurl);
diff --git a/plugins/mRadio/i_visual.inc b/plugins/mRadio/i_visual.inc index 5f56bcd4c7..68a7479312 100644 --- a/plugins/mRadio/i_visual.inc +++ b/plugins/mRadio/i_visual.inc @@ -9,8 +9,7 @@ var begin
FillChar(mi,SizeOf(mi),0);
mi.cbSize:=sizeof(mi);
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),
- PluginName)<>0 then
+ if StrCmp(Proto_GetProtoName(hContact),PluginName)<>0 then
begin
mi.flags:=CMIM_FLAGS or CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM,hCMenuItemPlay,tlparam(@mi));
diff --git a/plugins/mRadio/mradio.dpr b/plugins/mRadio/mradio.dpr index e929303b0d..2d60f57c1b 100644 --- a/plugins/mRadio/mradio.dpr +++ b/plugins/mRadio/mradio.dpr @@ -168,7 +168,7 @@ begin desc.cbSize:=PROTOCOLDESCRIPTOR_V3_SIZE;//SizeOf(desc);
desc.szName:=PluginName;
desc._type :=PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE,0,lparam(@desc));
+ Proto_RegisterModule(@desc);
// hooks and services
hhRadioStatus:=CreateHookableEvent(ME_RADIO_STATUS);
diff --git a/protocols/AimOscar/src/aim.cpp b/protocols/AimOscar/src/aim.cpp index f4f0e39df2..6650975186 100644 --- a/protocols/AimOscar/src/aim.cpp +++ b/protocols/AimOscar/src/aim.cpp @@ -109,7 +109,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) & pd);
+ Proto_RegisterModule( & pd);
InitIcons();
InitExtraIcons();
diff --git a/protocols/AimOscar/src/stdafx.h b/protocols/AimOscar/src/stdafx.h index 371dffa66f..f9d92fbd30 100644 --- a/protocols/AimOscar/src/stdafx.h +++ b/protocols/AimOscar/src/stdafx.h @@ -44,7 +44,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_netlib.h>
#include <m_options.h>
#include <m_popup.h>
-#include <m_protomod.h>
#include <m_userinfo.h>
#include <m_icolib.h>
#include <m_imgsrvc.h>
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index ce2fac297a..174764ee46 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -194,7 +194,7 @@ MCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool tempo if (addIfNeeded) {
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) == 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) == 0) {
setString(hContact, AIM_KEY_SN, norm_sn);
setString(hContact, AIM_KEY_NK, sn);
debugLogA("Adding contact %s to client side list.",norm_sn);
diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp index ec1c2e52eb..d5cb7ab141 100644 --- a/protocols/Dummy/src/main.cpp +++ b/protocols/Dummy/src/main.cpp @@ -87,7 +87,7 @@ extern "C" int __declspec(dllexport) Load() pd.fnInit = (pfnInitProto)dummyProtoInit; pd.fnUninit = (pfnUninitProto)dummyProtoUninit; pd.type = PROTOTYPE_PROTOCOL; - CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); + Proto_RegisterModule(&pd); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); return 0; diff --git a/protocols/Dummy/src/stdafx.h b/protocols/Dummy/src/stdafx.h index ac945252c3..7416c2aeef 100644 --- a/protocols/Dummy/src/stdafx.h +++ b/protocols/Dummy/src/stdafx.h @@ -47,7 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_message.h> #include <m_netlib.h> #include <m_options.h> -#include <m_protomod.h> #include <m_protosvc.h> #include <m_protoint.h> #include <m_skin.h> diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp index ec6c441374..abfb8bedfb 100644 --- a/protocols/EmLanProto/src/amdproto.cpp +++ b/protocols/EmLanProto/src/amdproto.cpp @@ -354,7 +354,7 @@ extern "C" int __declspec(dllexport) __cdecl Load() PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = PROTONAME;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(PROTONAME, PS_GETCAPS, EMPGetCaps);
CreateProtoServiceFunction(PROTONAME, PS_GETNAME, EMPGetName);
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 9ac8e81bd7..62a08d3196 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -237,7 +237,7 @@ MCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bo if (add_to_list) { MCONTACT res = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)res, (LPARAM)PROTONAME); + Proto_AddToContact(res, PROTONAME); db_set_dw(res, PROTONAME, "ipaddr", addr.S_un.S_addr); db_set_s(res, PROTONAME, "Nick", nick); diff --git a/protocols/EmLanProto/src/stdafx.h b/protocols/EmLanProto/src/stdafx.h index db054e03c0..3db62db596 100644 --- a/protocols/EmLanProto/src/stdafx.h +++ b/protocols/EmLanProto/src/stdafx.h @@ -14,8 +14,8 @@ #include <newpluginapi.h>
#include <m_options.h>
+#include <m_protosvc.h>
#include <m_database.h>
-#include <m_protomod.h>
#include <m_langpack.h>
#include "resource.h"
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index e94b84f6a7..d7b575f6ed 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -352,7 +352,7 @@ MCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, b // Try to make a new contact MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); - if (hContact && CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) != 0) { + if (hContact && Proto_AddToContact(hContact, m_szModuleName) != 0) { CallService(MS_DB_CONTACT_DELETE, hContact, 0); hContact = NULL; } diff --git a/protocols/FacebookRM/src/main.cpp b/protocols/FacebookRM/src/main.cpp index 0fa30147f4..f58efe34da 100644 --- a/protocols/FacebookRM/src/main.cpp +++ b/protocols/FacebookRM/src/main.cpp @@ -98,7 +98,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
InitIcons();
InitContactMenus();
diff --git a/protocols/FacebookRM/src/stdafx.h b/protocols/FacebookRM/src/stdafx.h index ce1b356b67..bcbf0f6298 100644 --- a/protocols/FacebookRM/src/stdafx.h +++ b/protocols/FacebookRM/src/stdafx.h @@ -51,7 +51,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_popup.h>
#include <m_protosvc.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_skin.h>
#include <m_icolib.h>
#include <m_hotkeys.h>
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index 1aa2733414..0c835729f6 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -446,7 +446,7 @@ static void sttCreateInstance(LPCSTR szModuleName) GoogleTalkAcc *gta = new GoogleTalkAcc();
gta->m_japi = japi;
- gta->m_pa = ProtoGetAccount(szModuleName);
+ gta->m_pa = Proto_GetAccount(szModuleName);
g_accs.insert(gta);
// Google Shared Status (http://code.google.com/apis/talk/jep_extensions/shared_status.html)
@@ -467,7 +467,7 @@ int ModulesLoaded(WPARAM, LPARAM) {
int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++)
sttCreateInstance(protos[i]->szModuleName);
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index e7813894c1..9f0dd6dbde 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -51,7 +51,7 @@ LPCSTR GetJidAcc(LPCTSTR jid) {
int count = 0;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
if (getJabberApi(protos[i]->szModuleName)) {
ptrT tszJid(db_get_tsa(0, protos[i]->szModuleName, "jid"));
@@ -171,7 +171,7 @@ MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
db_set_dw(0, acc, PSEUDOCONTACT_LINK, hContact);
db_set_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 1);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)acc);
+ Proto_AddToContact(hContact, acc);
}
// SetAvatar(hContact);
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp index b15eb53042..eb5286d7f5 100644 --- a/protocols/GTalkExt/src/options.cpp +++ b/protocols/GTalkExt/src/options.cpp @@ -241,7 +241,7 @@ int OptionsInitialization(WPARAM wParam, LPARAM) for (int i = 0; i < g_accs.getCount(); i++) {
LPCSTR szProto = g_accs[i]->m_pa->szModuleName;
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa != NULL) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.ptszTitle = pa->tszAccountName;
diff --git a/protocols/GTalkExt/src/stdafx.h b/protocols/GTalkExt/src/stdafx.h index 00a2ea659e..86f1fdb01b 100644 --- a/protocols/GTalkExt/src/stdafx.h +++ b/protocols/GTalkExt/src/stdafx.h @@ -54,7 +54,6 @@ #include <m_langpack.h>
#include <m_protosvc.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protoint.h>
#include <m_options.h>
#include <m_utils.h>
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 0a4883ba4b..47b20cb21d 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1543,7 +1543,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick) return NULL;
}
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) != 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) != 0) {
// For some reason we failed to register the protocol for this contact
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
debugLogA("getcontact(): Failed to register GG contact %d", uin);
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 1d62a341fd..de7203f4d9 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -342,10 +342,9 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnInit = (pfnInitProto)gg_proto_init;
pd.fnUninit = (pfnUninitProto)gg_proto_uninit;
pd.type = PROTOTYPE_PROTOCOL;
+ Proto_RegisterModule( &pd);
- // Register module
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) &pd);
- gg_links_instancemenu_init();
+ gg_links_instancemenu_init();
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index a2b2525ef3..308946b7c1 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -50,7 +50,6 @@ #include <m_database.h>
#include <m_netlib.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_langpack.h>
diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp index 08619f9d9f..e7652f349c 100644 --- a/protocols/ICQCorp/src/corp.cpp +++ b/protocols/ICQCorp/src/corp.cpp @@ -72,7 +72,7 @@ extern "C" __declspec(dllexport) int Load() PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = protoName;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
LoadServices();
return 0;
diff --git a/protocols/ICQCorp/src/corp.h b/protocols/ICQCorp/src/corp.h index 444f40382b..c703ee04ea 100644 --- a/protocols/ICQCorp/src/corp.h +++ b/protocols/ICQCorp/src/corp.h @@ -32,7 +32,6 @@ #include <newpluginapi.h>
#include <m_system.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_database.h>
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 1325126aa3..8a4967f5f1 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -1155,23 +1155,23 @@ void ICQ::updateContactList() //HANDLE hContact;
ICQUser *u;
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (proto && !mir_strcmp(proto, protoName))
- {
- if ((u = getUserByContact(hContact)) == NULL)
- {
- u = new ICQUser();
- u->hContact = hContact;
- u->uin = db_get_dw(hContact, protoName, "UIN", 0);
- icqUsers.push_back(u);
- }
- if (statusVal <= ID_STATUS_OFFLINE) u->setStatus(ID_STATUS_OFFLINE);
- else u->statusVal = db_get_w(hContact, protoName, "Status", ID_STATUS_OFFLINE);
- }
- }
-
- if (statusVal <= ID_STATUS_OFFLINE) return;
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ proto = GetContactProto(hContact);
+ if (proto && !mir_strcmp(proto, protoName))
+ {
+ if ((u = getUserByContact(hContact)) == NULL)
+ {
+ u = new ICQUser();
+ u->hContact = hContact;
+ u->uin = db_get_dw(hContact, protoName, "UIN", 0);
+ icqUsers.push_back(u);
+ }
+ if (statusVal <= ID_STATUS_OFFLINE) u->setStatus(ID_STATUS_OFFLINE);
+ else u->statusVal = db_get_w(hContact, protoName, "Status", ID_STATUS_OFFLINE);
+ }
+ }
+
+ if (statusVal <= ID_STATUS_OFFLINE) return;
// create user info packet
@@ -1298,40 +1298,40 @@ void ICQ::updateUserList(ICQUser *u, char list, char add) ICQUser *ICQ::addUser(unsigned int uin, bool persistent)
{
- unsigned int i;
- ICQUser *u;
-
- for (i=0; i<icqUsers.size(); i++)
- {
- u = icqUsers[i];
- if (u->uin == uin)
- {
- if (persistent)
- {
- db_unset(u->hContact, "CList", "NotOnList");
- db_unset(u->hContact, "CList", "Hidden");
- }
- return u;
- }
- }
-
- u = new ICQUser();
- u->uin = uin;
+ unsigned int i;
+ ICQUser *u;
+
+ for (i=0; i<icqUsers.size(); i++)
+ {
+ u = icqUsers[i];
+ if (u->uin == uin)
+ {
+ if (persistent)
+ {
+ db_unset(u->hContact, "CList", "NotOnList");
+ db_unset(u->hContact, "CList", "Hidden");
+ }
+ return u;
+ }
+ }
+
+ u = new ICQUser();
+ u->uin = uin;
u->hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- icqUsers.push_back(u);
+ icqUsers.push_back(u);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)u->hContact, (LPARAM)protoName);
- u->setInfo("UIN", uin);
+ Proto_AddToContact(u->hContact, protoName);
+ u->setInfo("UIN", uin);
- if (persistent) getUserInfo(u, true);
- else
- {
- db_set_b(u->hContact, "CList", "NotOnList", 1);
- db_set_b(u->hContact, "CList", "Hidden", 1);
- }
+ if (persistent) getUserInfo(u, true);
+ else
+ {
+ db_set_b(u->hContact, "CList", "NotOnList", 1);
+ db_set_b(u->hContact, "CList", "Hidden", 1);
+ }
- updateContactList();
- return u;
+ updateContactList();
+ return u;
}
///////////////////////////////////////////////////////////////////////////////
@@ -1814,7 +1814,7 @@ void ICQ::authorize(unsigned int uinToAuthorize) void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket)
{
- unsigned int i, checkUin, senderIp, localIp, userStatus, senderPort, junkLong, thePort, theTCPSequence;
+ unsigned int i, checkUin, senderIp, localIp, userStatus, senderPort, junkLong, thePort, theTCPSequence = 0;
unsigned short version, command, junkShort, newCommand, /*messageLen,*/ cicqVersion;
unsigned char cicqChar, junkChar;
char *message = NULL;
@@ -2190,7 +2190,7 @@ void ICQ::addMessage(ICQUser *u, char *m, unsigned short theCmd, unsigned short pre.timestamp = t;
pre.szMessage = (char*)m;
pre.lParam = 0;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
}
///////////////////////////////////////////////////////////////////////////////
@@ -2217,7 +2217,7 @@ void ICQ::addUrl(ICQUser *u, char *m, unsigned short theCmd, unsigned short theS pre.timestamp = t;
pre.szMessage = url;
pre.lParam = 0;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
delete [] url;
}
@@ -2239,7 +2239,7 @@ void ICQ::addAwayMsg(ICQUser *u, char *m, unsigned short theCmd, unsigned short pre.timestamp = t;
pre.szMessage = (char*)m;
pre.lParam = theSequence;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
}
///////////////////////////////////////////////////////////////////////////////
@@ -2313,7 +2313,7 @@ void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, un pre.timestamp = t;
pre.szMessage = szBlob;
pre.lParam = theSequence;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
delete [] szBlob;
diff --git a/protocols/ICQCorp/src/user.cpp b/protocols/ICQCorp/src/user.cpp index c70054e095..ba2fd4c2fb 100644 --- a/protocols/ICQCorp/src/user.cpp +++ b/protocols/ICQCorp/src/user.cpp @@ -140,20 +140,18 @@ static BOOL CALLBACK icqUserInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR int icqUserInfoInitialise(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- char *proto;
-
- proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, lParam, 0);
- if ((proto == NULL || mir_strcmp(proto, protoName)) && lParam) return 0;
-
- odp.position = -1900000000;
- odp.pszTitle = Translate(protoName);
- odp.pfnDlgProc = (DLGPROC)icqUserInfoDlgProc;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_INFO_ICQCORP);
- odp.hInstance = hInstance;
+ char *proto = GetContactProto(lParam);
+ if ((proto == NULL || mir_strcmp(proto, protoName)) && lParam)
+ return 0;
+
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.position = -1900000000;
+ odp.pszTitle = Translate(protoName);
+ odp.pfnDlgProc = (DLGPROC)icqUserInfoDlgProc;
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_INFO_ICQCORP);
+ odp.hInstance = hInstance;
Options_AddPage(wParam, &odp);
-
- return 0;
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 210024ffc0..8d6fac1a5c 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -99,7 +99,7 @@ MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) // here we create a new one since no one is to be found
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
if (InList)
db_unset(hContact, "CList", "NotOnList");
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp index 7f91134cc1..accf27a448 100644 --- a/protocols/IRCG/src/main.cpp +++ b/protocols/IRCG/src/main.cpp @@ -101,7 +101,7 @@ extern "C" int __declspec(dllexport) Load() pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)ircProtoInit;
pd.fnUninit = (pfnUninitProto)ircProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h index 506f831ed8..8cdf9c96b7 100644 --- a/protocols/IRCG/src/stdafx.h +++ b/protocols/IRCG/src/stdafx.h @@ -45,7 +45,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_system.h"
#include "m_system_cpp.h"
#include "m_protocols.h"
-#include "m_protomod.h"
#include "m_protosvc.h"
#include "m_protoint.h"
#include "m_clist.h"
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index a2d005fe47..ddaec0e16c 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -108,7 +108,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = icqProtoInit;
pd.fnUninit = icqProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// Initialize charset conversion routines
InitI18N();
diff --git a/protocols/IcqOscarJ/src/stdafx.h b/protocols/IcqOscarJ/src/stdafx.h index 431c4dcf10..b28a33ae00 100644 --- a/protocols/IcqOscarJ/src/stdafx.h +++ b/protocols/IcqOscarJ/src/stdafx.h @@ -63,7 +63,6 @@ #include <m_message.h>
#include <m_netlib.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_options.h>
#include <m_system.h>
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 3a5974df1a..9071a5a8bd 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -448,7 +448,7 @@ MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) return INVALID_CONTACT_ID;
}
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) != 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) != 0) {
// For some reason we failed to register the protocol to this contact
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
debugLogA("Failed to register ICQ contact %u", dwUin);
@@ -514,7 +514,7 @@ MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) debugLogA("Attempt to create ICQ contact by string <%s>", szUid);
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, UNIQUEIDSETTING, szUid);
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 97d203b105..caedaddab5 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -212,7 +212,7 @@ extern "C" int __declspec(dllexport) Load() pd.fnInit = (pfnInitProto)jabberProtoInit;
pd.fnUninit = (pfnUninitProto)jabberProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
g_IconsInit();
g_XstatusIconsInit();
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 4fe5a32f0c..6c9372874b 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -128,7 +128,7 @@ MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL }
MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hNewContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hNewContact, m_szModuleName);
setTString(hNewContact, "jid", s);
if (nick != NULL && *nick != '\0')
setTString(hNewContact, "Nick", nick);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index df78bae751..076e76aeca 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -301,7 +301,7 @@ MCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags) // not already there: add
debugLog(_T("Add new jid to contact jid = %s"), newJid);
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setTString(hContact, "jid", newJid);
// Note that by removing or disable the "NotOnList" will trigger
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 14e275df5c..93ef27846b 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -800,7 +800,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP int CJabberProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) { - if (!ProtoGetAccount(m_szModuleName)) + if (!Proto_GetAccount(m_szModuleName)) return 0; MCONTACT hContact = lParam; diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index db155e7555..d92cad8c6c 100644 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -81,7 +81,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_message.h>
#include <m_netlib.h>
#include <m_options.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index a58b7b23ea..0acd463767 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -92,7 +92,7 @@ extern "C" __declspec(dllexport) int Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)mraProtoInit;
pd.fnUninit = (pfnUninitProto)mraProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index f7ef7aa58c..8197824146 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -543,7 +543,7 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe }
else {
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
}
if (hContact) {
@@ -711,7 +711,7 @@ bool IsHTTPSProxyUsed(HANDLE hNetlibUser) // îïðåäåëÿåò ïðèíàäëåæíîñòü êîíòàêòà äàííîé êîïèè ïëàãèíà
bool CMraProto::IsContactMra(MCONTACT hContact)
{
- return CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)m_szModuleName) != 0;
+ return Proto_IsProtoOnContact(hContact, m_szModuleName) != 0;
}
// îïðåäåëÿåòñÿ ÿâëÿåòñÿ ëè êîíòàêò êîíòàêòîì MRA ïðîòîêîëà, íå çàâèñèìî îò òîãî êàêîìó ïëàãèíó îí ïðèíàäëåæèò
@@ -887,7 +887,9 @@ void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode static void FakeThread(void* param)
{
Sleep(100);
- CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)param);
+
+ ACKDATA *ack = (ACKDATA*)param;
+ ProtoBroadcastAck(ack->szModule, ack->hContact, ack->type, ack->result, ack->hProcess, ack->lParam);
mir_free(param);
}
diff --git a/protocols/MRA/src/stdafx.h b/protocols/MRA/src/stdafx.h index 39d1253497..f5b3741957 100644 --- a/protocols/MRA/src/stdafx.h +++ b/protocols/MRA/src/stdafx.h @@ -32,7 +32,6 @@ #include <m_ignore.h>
#include <m_message.h>
#include <m_options.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp index 8f4200e74a..ec7f204449 100644 --- a/protocols/MSN/src/msn.cpp +++ b/protocols/MSN/src/msn.cpp @@ -122,7 +122,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnInit = (pfnInitProto)msnProtoInit;
pd.fnUninit = (pfnUninitProto)msnProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
MsnInitIcons();
MSN_InitContactMenu();
diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp index bfa8f8253c..3c875990b7 100644 --- a/protocols/MSN/src/msn_contact.cpp +++ b/protocols/MSN/src/msn_contact.cpp @@ -37,7 +37,7 @@ MCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, if (hContact == NULL && addIfNeeded) {
int netId = (msc && msc->netId)?msc->netId:(szNet?atoi(szNet):NETID_MSN);
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
if (netId != NETID_SKYPE) setString(hContact, "e-mail", szEmail);
setStringUtf(hContact, "Nick", msnNick ? msnNick : szEmail);
setWord(hContact, "netId", netId);
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h index fa4a6f165a..5bdd6c9098 100644 --- a/protocols/MSN/src/stdafx.h +++ b/protocols/MSN/src/stdafx.h @@ -45,7 +45,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_message.h>
#include <m_options.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/MinecraftDynmap/src/main.cpp b/protocols/MinecraftDynmap/src/main.cpp index fd618ed8e9..9f60c4d084 100644 --- a/protocols/MinecraftDynmap/src/main.cpp +++ b/protocols/MinecraftDynmap/src/main.cpp @@ -98,7 +98,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL; pd.fnInit = protoInit; pd.fnUninit = protoUninit; - CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd)); + Proto_RegisterModule(&pd); InitIcons(); diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp index da8afbbcd6..fdc7d17897 100644 --- a/protocols/Omegle/src/main.cpp +++ b/protocols/Omegle/src/main.cpp @@ -100,7 +100,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE,0,reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
InitIcons();
//InitContactMenus();
diff --git a/protocols/Sametime/src/StdAfx.h b/protocols/Sametime/src/StdAfx.h index 7fbf8e695a..d1e286e1d4 100644 --- a/protocols/Sametime/src/StdAfx.h +++ b/protocols/Sametime/src/StdAfx.h @@ -65,7 +65,6 @@ extern "C" { #include <m_netlib.h>
#include <m_database.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_ignore.h>
#include <m_clui.h>
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index bf324f6528..d29923d882 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -271,7 +271,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.szName = "Sametime";
pd.fnInit = (pfnInitProto)sametime_proto_init;
pd.fnUninit = (pfnUninitProto)sametime_proto_uninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index a38c1e44d4..6db619e1d5 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -76,7 +76,7 @@ MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary) debugLog(_T("AddContact(): Failed to create Sametime contact"));
return NULL; ///TODO error handling
}
- if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) != 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) != 0) {
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
debugLog(_T("AddContact(): Failed to register Sametime contact"));
return NULL; ///TODO error handling
diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp index ce02a8ea26..103306d981 100644 --- a/protocols/SkypeWeb/src/main.cpp +++ b/protocols/SkypeWeb/src/main.cpp @@ -68,7 +68,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)CSkypeProto::InitAccount;
pd.fnUninit = (pfnUninitProto)CSkypeProto::UninitAccount;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CSkypeProto::InitIcons();
CSkypeProto::InitMenus();
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 1afb872205..68b354d40c 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -90,7 +90,7 @@ MCONTACT CSkypeProto::AddContact(const char *skypename, bool isTemporary) if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, SKYPE_SETTINGS_ID, skypename);
diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h index a4250c6e65..bdc07e528a 100644 --- a/protocols/SkypeWeb/src/stdafx.h +++ b/protocols/SkypeWeb/src/stdafx.h @@ -30,7 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <newpluginapi.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_database.h>
diff --git a/protocols/Steam/src/main.cpp b/protocols/Steam/src/main.cpp index fa597983d9..5f67cea6a6 100644 --- a/protocols/Steam/src/main.cpp +++ b/protocols/Steam/src/main.cpp @@ -44,7 +44,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)CSteamProto::InitProtoInstance;
pd.fnUninit = (pfnUninitProto)CSteamProto::UninitProtoInstance;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
char iconName[100];
mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, "gaming");
diff --git a/protocols/Steam/src/stdafx.h b/protocols/Steam/src/stdafx.h index 489c994784..7aecea533b 100644 --- a/protocols/Steam/src/stdafx.h +++ b/protocols/Steam/src/stdafx.h @@ -23,7 +23,6 @@ #include <m_freeimage.h>
#include <m_imgsrvc.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_idle.h>
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 72a5422e5a..f9a6b0c0c0 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -296,7 +296,7 @@ MCONTACT CSteamProto::AddContact(const char *steamId, bool isTemporary) { // create contact hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)this->m_szModuleName); + Proto_AddToContact(hContact, this->m_szModuleName); setString(hContact, "SteamID", steamId); diff --git a/protocols/Steam/src/steam_instances.cpp b/protocols/Steam/src/steam_instances.cpp index edd1eaef7f..d535e53b09 100644 --- a/protocols/Steam/src/steam_instances.cpp +++ b/protocols/Steam/src/steam_instances.cpp @@ -32,8 +32,7 @@ void CSteamProto::UninitProtoInstances() CSteamProto* CSteamProto::GetContactProtoInstance(MCONTACT hContact)
{
- char *proto = (char *)::CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0);
-
+ char *proto = GetContactProto(hContact);
if (proto == NULL)
return NULL;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 077b6a5933..8ae89022a8 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -375,8 +375,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnInit = ( pfnInitProto )tlenProtoInit;
pd.fnUninit = ( pfnUninitProto )tlenProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) &pd);
-
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/Tlen/src/tlen.h b/protocols/Tlen/src/tlen.h index 2207ba640f..2c1f51c5f4 100644 --- a/protocols/Tlen/src/tlen.h +++ b/protocols/Tlen/src/tlen.h @@ -59,7 +59,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_system.h>
#include <m_system_cpp.h>
#include <m_netlib.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_contacts.h>
diff --git a/protocols/Tlen/src/tlen_misc.cpp b/protocols/Tlen/src/tlen_misc.cpp index fd868ecc5a..37692d98b1 100644 --- a/protocols/Tlen/src/tlen_misc.cpp +++ b/protocols/Tlen/src/tlen_misc.cpp @@ -46,7 +46,7 @@ void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick) if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) {
hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)proto->m_szModuleName);
+ Proto_AddToContact(hContact, proto->m_szModuleName);
// strip resource if present
s = TlenLoginFromJID(jid);
_strlwr(s);
@@ -114,7 +114,7 @@ MCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL te if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) {
hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)proto->m_szModuleName);
+ Proto_AddToContact(hContact, proto->m_szModuleName);
db_set_s(hContact, proto->m_szModuleName, "jid", jid);
if (nick != NULL && nick[0] != '\0')
db_set_s(hContact, proto->m_szModuleName, "Nick", nick);
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index a6adc2dc97..75dfe31c80 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -183,7 +183,7 @@ static MCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD fl // not already there: add
char *jid = mir_strdup(newJid); _strlwr(jid);
hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM) proto->m_szModuleName);
+ Proto_AddToContact(hContact, proto->m_szModuleName);
db_set_s(hContact, proto->m_szModuleName, "jid", jid);
char *nick=TlenNickFromJID(newJid);
if (nick == NULL)
diff --git a/protocols/Tlen/src/tlen_userinfo.cpp b/protocols/Tlen/src/tlen_userinfo.cpp index 453b0120c8..161bb926ae 100644 --- a/protocols/Tlen/src/tlen_userinfo.cpp +++ b/protocols/Tlen/src/tlen_userinfo.cpp @@ -127,7 +127,7 @@ static void FetchCombo(HWND hwndDlg, UINT idCtrl, char *fieldName, char **str, i int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam)
{
- if (!ProtoGetAccount(m_szModuleName))
+ if (!Proto_GetAccount(m_szModuleName))
return 0;
MCONTACT hContact = (MCONTACT) lParam;
diff --git a/protocols/Tox/src/stdafx.h b/protocols/Tox/src/stdafx.h index 82ef5e31e3..3a5cfafe8b 100644 --- a/protocols/Tox/src/stdafx.h +++ b/protocols/Tox/src/stdafx.h @@ -17,7 +17,6 @@ #include <newpluginapi.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_database.h>
diff --git a/protocols/Tox/src/tox.cpp b/protocols/Tox/src/tox.cpp index f6c89d2a00..3643149fbd 100644 --- a/protocols/Tox/src/tox.cpp +++ b/protocols/Tox/src/tox.cpp @@ -49,7 +49,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)CToxProto::InitAccount;
pd.fnUninit = (pfnUninitProto)CToxProto::UninitAccount;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
HookEvent(ME_SYSTEM_MODULESLOADED, &CToxProto::OnModulesLoaded);
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp index 27aa4c7444..629d46c510 100644 --- a/protocols/Tox/src/tox_chatrooms.cpp +++ b/protocols/Tox/src/tox_chatrooms.cpp @@ -24,7 +24,7 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber) if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setWord(hContact, TOX_SETTINGS_CHAT_ID, groupNumber);
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 532f23ab48..069f368990 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -69,7 +69,7 @@ MCONTACT CToxProto::AddContact(const char *address, const char *nick, const char if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, TOX_SETTINGS_ID, address);
@@ -376,7 +376,7 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE int CToxProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
{
- if (!CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)m_szModuleName))
+ if (!Proto_IsProtocolLoaded(m_szModuleName))
return 0;
MCONTACT hContact = lParam;
diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 99e954b5f2..ccae792f37 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -237,7 +237,7 @@ MCONTACT TwitterProto::AddToClientList(const char *name, const char *status) // If not, make a new contact!
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) == 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) == 0) {
db_set_s(hContact, m_szModuleName, TWITTER_KEY_UN, name);
db_set_w(hContact, m_szModuleName, "Status", ID_STATUS_ONLINE);
db_set_utf(hContact, "CList", "StatusMsg", status);
diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp index 2503f64da5..58bc371096 100644 --- a/protocols/Twitter/src/main.cpp +++ b/protocols/Twitter/src/main.cpp @@ -96,7 +96,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
InitIcons();
InitContactMenus();
diff --git a/protocols/Twitter/src/stdafx.h b/protocols/Twitter/src/stdafx.h index 9c12e052fa..2a2287db6b 100644 --- a/protocols/Twitter/src/stdafx.h +++ b/protocols/Twitter/src/stdafx.h @@ -52,7 +52,6 @@ typedef std::basic_string<TCHAR> tstring; #include <m_options.h>
#include <m_popup.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/VKontakte/src/main.cpp b/protocols/VKontakte/src/main.cpp index e6ff1af0b9..7974618a9b 100644 --- a/protocols/VKontakte/src/main.cpp +++ b/protocols/VKontakte/src/main.cpp @@ -81,7 +81,7 @@ extern "C" int __declspec(dllexport) Load() pd.fnInit = (pfnInitProto)vkProtoInit;
pd.fnUninit = (pfnUninitProto)vkProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 0c6d23000a..85c2c6cbb0 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -263,7 +263,7 @@ MCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate) return NULL;
MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hNewContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hNewContact, m_szModuleName);
setDword(hNewContact, "ID", dwUserid);
db_set_ts(hNewContact, "CList", "Group", m_defaultGroup);
return hNewContact;
diff --git a/protocols/VKontakte/src/stdafx.h b/protocols/VKontakte/src/stdafx.h index 0748199a1d..475b19372c 100644 --- a/protocols/VKontakte/src/stdafx.h +++ b/protocols/VKontakte/src/stdafx.h @@ -49,7 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_message.h>
#include <m_netlib.h>
#include <m_options.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/WhatsApp/src/common.h b/protocols/WhatsApp/src/common.h index e3e1ceb679..c602a4fc09 100644 --- a/protocols/WhatsApp/src/common.h +++ b/protocols/WhatsApp/src/common.h @@ -54,7 +54,6 @@ Copyright © 2013-14 Uli Hecht #include <m_protocols.h>
#include <m_protosvc.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_skin.h>
#include <m_string.h>
#include <statusmodes.h>
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 3756fded33..20c04040f0 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -36,7 +36,7 @@ MCONTACT WhatsAppProto::AddToContactList(const std::string &jid, const char *new if ((hContact = CallService(MS_DB_CONTACT_ADD, 0, 0)) == 0)
return INVALID_CONTACT_ID;
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, "ID", jid.c_str());
debugLogA("Added contact %s", jid.c_str());
setString(hContact, "MirVer", "WhatsApp");
diff --git a/protocols/WhatsApp/src/main.cpp b/protocols/WhatsApp/src/main.cpp index 93abf0bbc0..5d0697d998 100644 --- a/protocols/WhatsApp/src/main.cpp +++ b/protocols/WhatsApp/src/main.cpp @@ -74,7 +74,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
InitIcons();
//InitContactMenus();
diff --git a/protocols/Xfire/src/all_statusmsg.cpp b/protocols/Xfire/src/all_statusmsg.cpp index f5910b2df5..42936c9df0 100644 --- a/protocols/Xfire/src/all_statusmsg.cpp +++ b/protocols/Xfire/src/all_statusmsg.cpp @@ -57,7 +57,7 @@ BOOL BackupStatusMsg() { oltostatus = new vector < unsigned int > ;
//alle protokolle durchgehen und den status in den vector sichern
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&anz, (LPARAM)&temp);
+ Proto_EnumAccounts(&anz, &temp);
for (int i = 0; i < anz; i++)
{
statusid = CallProtoService(temp[i]->szModuleName, PS_GETSTATUS, 0, 0);
@@ -225,7 +225,7 @@ BOOL SetGameStatusMsg() statusMsg = statusmsg;
}
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&anz, (LPARAM)&temp);
+ Proto_EnumAccounts(&anz, &temp);
for (int i = 0; i < anz; i++)
{
if (olstatus->at(i) != -1)
@@ -290,7 +290,7 @@ BOOL SetOldStatusMsg() if (olstatusmsg == NULL)
return FALSE;
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&anz, (LPARAM)&temp);
+ Proto_EnumAccounts(&anz, &temp);
for (int i = 0; i < anz; i++)
{
if (olstatus->at(i) != -1)
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 9a2e1f51f0..fd04b1f76e 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -1053,8 +1053,7 @@ extern "C" __declspec(dllexport) int Load(void) PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = protocolname;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
-
+ Proto_RegisterModule(&pd);
hLogEvent = CreateHookableEvent("XFireProtocol/Log");
@@ -1592,7 +1591,7 @@ MCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline, int cla // here we create a new one since no one is to be found
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)protocolname);
+ Proto_AddToContact(hContact, protocolname);
if (InList)
db_unset(hContact, "CList", "NotOnList");
diff --git a/protocols/Xfire/src/stdafx.h b/protocols/Xfire/src/stdafx.h index eb20af3e4d..f6cd6313c2 100644 --- a/protocols/Xfire/src/stdafx.h +++ b/protocols/Xfire/src/stdafx.h @@ -53,11 +53,9 @@ #include <m_clui.h>
#include <m_skin.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_database.h>
#include <m_system.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_userinfo.h>
diff --git a/protocols/Yahoo/src/main.cpp b/protocols/Yahoo/src/main.cpp index 74d61a4fbc..ea336f0fd9 100644 --- a/protocols/Yahoo/src/main.cpp +++ b/protocols/Yahoo/src/main.cpp @@ -105,7 +105,7 @@ extern "C" int __declspec(dllexport)Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)yahooProtoInit;
pd.fnUninit = (pfnUninitProto)yahooProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index d77b172cd6..5900aea998 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -13,7 +13,6 @@ #include "yahoo.h"
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_skin.h>
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index 030599d82a..098eae59e7 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -13,7 +13,6 @@ #include "yahoo.h"
#include <windowsx.h>
#include <m_popup.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_skin.h>
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 394e979589..7e98c01909 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -262,7 +262,7 @@ MCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, in //not already there: add
LOG(("[add_buddy] Adding buddy id: %s (Nick: %s), flags: %lu", yid, yahoo_name, flags));
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, YAHOO_LOGINID, yid);
Set_Protocol(hContact, protocol);
diff --git a/protocols/Yahoo/src/yahoo.h b/protocols/Yahoo/src/yahoo.h index 97c38e77ae..d90d1abcb7 100644 --- a/protocols/Yahoo/src/yahoo.h +++ b/protocols/Yahoo/src/yahoo.h @@ -35,7 +35,6 @@ #include <m_system_cpp.h>
#include <m_database.h>
-#include <m_protomod.h>
#include <m_netlib.h>
#include <m_idle.h>
#include <m_clist.h>
diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp index a1a7897249..4d4674d81c 100644 --- a/src/core/stdauth/src/authdialogs.cpp +++ b/src/core/stdauth/src/authdialogs.cpp @@ -53,7 +53,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, CallProtoService(dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0));
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, CallProtoService(dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_LARGE, 0));
- PROTOACCOUNT* acc = ProtoGetAccount(dbei.szModule);
+ PROTOACCOUNT* acc = Proto_GetAccount(dbei.szModule);
TCHAR* lastT = dbei.flags & DBEF_UTF ? Utf8DecodeT(last) : mir_a2t(last);
TCHAR* firstT = dbei.flags & DBEF_UTF ? Utf8DecodeT(first) : mir_a2t(first);
@@ -177,7 +177,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, CallProtoService(dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0));
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, CallProtoService(dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_LARGE, 0));
- PROTOACCOUNT* acc = ProtoGetAccount(dbei.szModule);
+ PROTOACCOUNT* acc = Proto_GetAccount(dbei.szModule);
ptrT lastT(dbei.flags & DBEF_UTF ? Utf8DecodeT(last) : mir_a2t(last));
ptrT firstT(dbei.flags & DBEF_UTF ? Utf8DecodeT(first) : mir_a2t(first));
diff --git a/src/core/stdauth/src/commonheaders.h b/src/core/stdauth/src/commonheaders.h index 1ba20c8690..9ac9abbf2a 100644 --- a/src/core/stdauth/src/commonheaders.h +++ b/src/core/stdauth/src/commonheaders.h @@ -54,7 +54,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stdautoaway/src/autoaway.cpp b/src/core/stdautoaway/src/autoaway.cpp index e3aa0603de..9084ab7f61 100644 --- a/src/core/stdautoaway/src/autoaway.cpp +++ b/src/core/stdautoaway/src/autoaway.cpp @@ -69,7 +69,7 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam) int numAccounts;
PROTOACCOUNT** accounts;
- ProtoEnumAccounts(&numAccounts, &accounts);
+ Proto_EnumAccounts(&numAccounts, &accounts);
for (int i = 0; i < numAccounts; i++) {
PROTOACCOUNT *pa = accounts[i];
diff --git a/src/core/stdautoaway/src/commonheaders.h b/src/core/stdautoaway/src/commonheaders.h index efdb7396e7..4e6c33ab90 100644 --- a/src/core/stdautoaway/src/commonheaders.h +++ b/src/core/stdautoaway/src/commonheaders.h @@ -51,7 +51,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stdaway/src/commonheaders.h b/src/core/stdaway/src/commonheaders.h index ea2707e767..cac3b84b67 100644 --- a/src/core/stdaway/src/commonheaders.h +++ b/src/core/stdaway/src/commonheaders.h @@ -52,7 +52,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 1347036dd4..f40abdec32 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -186,7 +186,7 @@ void ChangeAllProtoMessages(char *szProto, int statusMode, TCHAR *msg) if (szProto == NULL) {
int nAccounts;
PROTOACCOUNT **accounts;
- ProtoEnumAccounts(&nAccounts, &accounts);
+ Proto_EnumAccounts(&nAccounts, &accounts);
for (int i = 0; i < nAccounts; i++) {
PROTOACCOUNT *pa = accounts[i];
@@ -575,7 +575,7 @@ static int AwayMsgSendAccountsChanged(WPARAM, LPARAM) int nAccounts;
PROTOACCOUNT** accounts;
- ProtoEnumAccounts(&nAccounts, &accounts);
+ Proto_EnumAccounts(&nAccounts, &accounts);
for (int i = 0; i < nAccounts; i++) {
if (!Proto_IsAccountEnabled(accounts[i]))
continue;
diff --git a/src/core/stdchat/src/chat.h b/src/core/stdchat/src/chat.h index 6e66536072..d2706c8605 100644 --- a/src/core/stdchat/src/chat.h +++ b/src/core/stdchat/src/chat.h @@ -46,7 +46,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h>
#include <m_skin.h>
#include <m_button.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_clist.h>
#include <m_clistint.h>
diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index aad1364110..4c4d871ec1 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -127,9 +127,9 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
- if (!IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ if (!Proto_IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
diff --git a/src/core/stdcrypt/src/commonheaders.h b/src/core/stdcrypt/src/commonheaders.h index 43da7d6c65..32c6f26034 100644 --- a/src/core/stdcrypt/src/commonheaders.h +++ b/src/core/stdcrypt/src/commonheaders.h @@ -50,7 +50,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stdemail/src/commonheaders.h b/src/core/stdemail/src/commonheaders.h index 537c6293fa..5d64b310f8 100644 --- a/src/core/stdemail/src/commonheaders.h +++ b/src/core/stdemail/src/commonheaders.h @@ -51,7 +51,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stdfile/src/commonheaders.h b/src/core/stdfile/src/commonheaders.h index b476a77cf1..c028084e09 100644 --- a/src/core/stdfile/src/commonheaders.h +++ b/src/core/stdfile/src/commonheaders.h @@ -56,7 +56,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_protoint.h>
#include <m_options.h>
diff --git a/src/core/stdhelp/src/commonheaders.h b/src/core/stdhelp/src/commonheaders.h index e1763c4cc8..ef3c230d8f 100644 --- a/src/core/stdhelp/src/commonheaders.h +++ b/src/core/stdhelp/src/commonheaders.h @@ -52,7 +52,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stdidle/src/commonheaders.h b/src/core/stdidle/src/commonheaders.h index 4294473f85..565408f1ba 100644 --- a/src/core/stdidle/src/commonheaders.h +++ b/src/core/stdidle/src/commonheaders.h @@ -53,7 +53,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stduihist/src/commonheaders.h b/src/core/stduihist/src/commonheaders.h index 93fb17ecb2..52ab245752 100644 --- a/src/core/stduihist/src/commonheaders.h +++ b/src/core/stduihist/src/commonheaders.h @@ -52,7 +52,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stdurl/commonheaders.h b/src/core/stdurl/commonheaders.h index 6651d1f240..3acf6d5748 100644 --- a/src/core/stdurl/commonheaders.h +++ b/src/core/stdurl/commonheaders.h @@ -52,7 +52,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stduserinfo/src/commonheaders.h b/src/core/stduserinfo/src/commonheaders.h index ec79f2ea84..49583b6a21 100644 --- a/src/core/stduserinfo/src/commonheaders.h +++ b/src/core/stduserinfo/src/commonheaders.h @@ -54,7 +54,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stduseronline/src/commonheaders.h b/src/core/stduseronline/src/commonheaders.h index 774e7c6dcc..df5c89598e 100644 --- a/src/core/stduseronline/src/commonheaders.h +++ b/src/core/stduseronline/src/commonheaders.h @@ -51,7 +51,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_clistint.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index e2cb2cc85b..32e5bcb2b8 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -93,7 +93,7 @@ static int UserOnlineModulesLoaded(WPARAM, LPARAM) {
int numAccounts;
PROTOACCOUNT** accounts;
- ProtoEnumAccounts(&numAccounts, &accounts);
+ Proto_EnumAccounts(&numAccounts, &accounts);
// reset the counter
for (int i = 0; i < numAccounts; i++)
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index 26dbd2ed74..cd633f600b 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -59,7 +59,7 @@ MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDi if ((hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0)) == NULL)
return NULL;
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)pszModule);
+ Proto_AddToContact(hContact, pszModule);
if (pszGroup[0])
db_set_ts(hContact, "CList", "Group", pszGroup);
else
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 9d7936f926..00b3f90e5d 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -183,7 +183,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa else
pd.lchIcon = LoadIconEx("window", FALSE);
- PROTOACCOUNT *pa = ProtoGetAccount(pszProtoName);
+ PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_sntprintf(pd.lptzContactName, SIZEOF(pd.lptzContactName), _T("%s - %s"),
(pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
cli.pfnGetContactDisplayName(hContact, 0));
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 2d1729ad73..90ee313f47 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -100,7 +100,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) DBVARIANT dbv;
CONTACTINFO *ci = (CONTACTINFO*)lParam;
if (ci == NULL) return 1;
- if (ci->szProto == NULL) ci->szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, (WPARAM)ci->hContact, 0);
+ if (ci->szProto == NULL) ci->szProto = Proto_GetBaseAccountName(ci->hContact);
if (ci->szProto == NULL) return 1;
ci->type = 0;
diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp index b8c1af1b1b..5fc8208104 100644 --- a/src/mir_app/src/ignore.cpp +++ b/src/mir_app/src/ignore.cpp @@ -365,30 +365,34 @@ static INT_PTR Unignore(WPARAM wParam, LPARAM lParam) static INT_PTR IgnoreRecvMessage(WPARAM wParam, LPARAM lParam)
{
- if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact, IGNOREEVENT_MESSAGE))
+ CCSDATA *ccs = (CCSDATA*)lParam;
+ if (IsIgnored(ccs->hContact, IGNOREEVENT_MESSAGE))
return 1;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
}
static INT_PTR IgnoreRecvUrl(WPARAM wParam, LPARAM lParam)
{
- if ( IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact, IGNOREEVENT_URL))
+ CCSDATA *ccs = (CCSDATA*)lParam;
+ if (IsIgnored(ccs->hContact, IGNOREEVENT_URL))
return 1;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
}
static INT_PTR IgnoreRecvFile(WPARAM wParam, LPARAM lParam)
{
- if ( IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact, IGNOREEVENT_FILE))
+ CCSDATA *ccs = (CCSDATA*)lParam;
+ if (IsIgnored(ccs->hContact, IGNOREEVENT_FILE))
return 1;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
}
static INT_PTR IgnoreRecvAuth(WPARAM wParam, LPARAM lParam)
{
- if ( IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact, IGNOREEVENT_AUTHORIZATION))
+ CCSDATA *ccs = (CCSDATA*)lParam;
+ if (IsIgnored(ccs->hContact, IGNOREEVENT_AUTHORIZATION))
return 1;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
}
static int IgnoreAddedNotify(WPARAM, LPARAM lParam)
@@ -420,10 +424,11 @@ static int IgnoreModernOptInit(WPARAM wParam, LPARAM) int LoadIgnoreModule(void)
{
- PROTOCOLDESCRIPTOR pd = { sizeof(pd) };
+ PROTOCOLDESCRIPTOR pd = { 0 };
+ pd.cbSize = sizeof(pd);
pd.szName = "Ignore";
pd.type = PROTOTYPE_IGNORE;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction("Ignore", PSR_MESSAGE, IgnoreRecvMessage);
CreateProtoServiceFunction("Ignore", PSR_URL, IgnoreRecvUrl);
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index 70f0944e59..b82d3f531c 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -63,7 +63,7 @@ static void FillContactList(HWND hList) LvItem.iSubItem = 1; // id
char *szProto = GetContactProto(g_data.hContact[i]);
if (szProto) {
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
char *szField = (char *)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
diff --git a/src/mir_app/src/meta_main.cpp b/src/mir_app/src/meta_main.cpp index 3add80aee5..3c18940afe 100644 --- a/src/mir_app/src/meta_main.cpp +++ b/src/mir_app/src/meta_main.cpp @@ -73,11 +73,11 @@ int LoadMetacontacts(void) pd.cbSize = sizeof(pd);
pd.szName = META_FILTER;
pd.type = PROTOTYPE_FILTER;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
pd.szName = META_PROTO;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// further db setup done in modules loaded (nick [protocol string required] & clist display name)
Meta_InitServices();
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index b2c168b169..49901c6412 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -64,7 +64,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM) currDb->MetaSetDefault(cc); // explicitly write default sub to a db
// Add the MetaContact protocol to the new meta contact
- CallService(MS_PROTO_ADDTOCONTACT, hMetaContact, (LPARAM)META_PROTO);
+ Proto_AddToContact(hMetaContact, META_PROTO);
if (tszGroup)
db_set_ts(hMetaContact, "CList", "Group", tszGroup);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 0721e6640e..5c6962f8cd 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -134,7 +134,7 @@ static INT_PTR MetaFilter_RecvMessage(WPARAM wParam, LPARAM lParam) if (cc && cc->IsSub())
Meta_SetSrmmSub(cc->parentID, cc->contactID);
- CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ Proto_ChainRecv(wParam, ccs);
return 0;
}
@@ -231,7 +231,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam, LPARAM lParam) if (cc == NULL || cc->nDefault == -1) {
// This is a simple contact, let through the stack of protocols
// (this should normally not happen, since linked contacts do not appear on the list.)
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
MCONTACT hMostOnline = db_mc_getSrmmSub(cc->contactID);
@@ -599,7 +599,7 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam) char *szProto = GetContactProto(cc->pSubs[i]);
if (szProto == NULL) continue;
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa == NULL)
continue;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 6eb3303181..e7a09d548a 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -129,3 +129,16 @@ ProtoWindowAdd @126 ProtoWindowRemove @127
Proto_IsProtocolLoaded @128
GetPluginFakeId @129
+Proto_GetAccount @130
+Proto_EnumProtocols @131
+Proto_EnumAccounts @132
+Proto_IsAccountEnabled @133
+Proto_IsAccountLocked @134
+Proto_GetBaseAccountName @135
+GetContactProto @136
+Proto_AddToContact @137
+Proto_ChainRecv @138
+Proto_ChainSend @139
+Proto_IsProtoOnContact @140
+Proto_RegisterModule @141
+Proto_RemoveFromContact @142
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 4bd307a4ff..39b2b30b5c 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -129,3 +129,16 @@ ProtoWindowAdd @126 ProtoWindowRemove @127
Proto_IsProtocolLoaded @128
GetPluginFakeId @129
+Proto_GetAccount @130
+Proto_EnumProtocols @131
+Proto_EnumAccounts @132
+Proto_IsAccountEnabled @133
+Proto_IsAccountLocked @134
+Proto_GetBaseAccountName @135
+GetContactProto @136
+Proto_AddToContact @137
+Proto_ChainRecv @138
+Proto_ChainSend @139
+Proto_IsProtoOnContact @140
+Proto_RegisterModule @141
+Proto_RemoveFromContact @142
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index a1fad48c77..24486ff3aa 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -148,10 +148,8 @@ INT_PTR ProtoCallService(LPCSTR szModule, const char *szService, WPARAM wParam, PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const TCHAR *tszAccountName);
-PROTOACCOUNT* __fastcall Proto_GetAccount(const char *accName);
PROTOACCOUNT* __fastcall Proto_GetAccount(MCONTACT hContact);
-bool __fastcall Proto_IsAccountEnabled(PROTOACCOUNT *pa);
bool __fastcall Proto_IsAccountLocked(PROTOACCOUNT *pa);
PROTO_INTERFACE* AddDefaultAccount(const char *szProtoName);
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index 1df4dab0ea..8e6ea249a9 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -254,7 +254,7 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, MCONTACT hContact) else if (!_xcscmp(theKey, XSTR(key, "proto")))
theValue = mir_a2x(key, GetContactProto(hContact));
else if (!_xcscmp(theKey, XSTR(key, "accountname"))) {
- PROTOACCOUNT *acc = ProtoGetAccount(GetContactProto(hContact));
+ PROTOACCOUNT *acc = Proto_GetAccount(GetContactProto(hContact));
if (acc != NULL)
theValue = mir_a2x(key, _T2A(acc->tszAccountName));
}
diff --git a/src/mir_app/src/proto_chains.cpp b/src/mir_app/src/proto_chains.cpp index e7f4348fe0..e8b425e3e1 100644 --- a/src/mir_app/src/proto_chains.cpp +++ b/src/mir_app/src/proto_chains.cpp @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "stdafx.h"
-#include <m_protomod.h>
extern LIST<PROTOCOLDESCRIPTOR> filters;
@@ -56,48 +55,15 @@ static int GetProtocolP(MCONTACT hContact, char *szBuf, int cbLen) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(INT_PTR) CallContactService(MCONTACT hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(INT_PTR) Proto_ChainSend(int iOrder, CCSDATA *ccs)
{
INT_PTR ret;
- CCSDATA ccs = { hContact, szProtoService, wParam, lParam };
- for (int i = 0; i < filters.getCount(); i++) {
- if ((ret = CallProtoServiceInt(hContact, filters[i]->szName, szProtoService, i + 1, (LPARAM)&ccs)) != CALLSERVICE_NOTFOUND) {
- //chain was started, exit
- return ret;
- }
- }
-
- char szProto[40];
- if (GetProtocolP((MCONTACT)hContact, szProto, sizeof(szProto)))
+ if (iOrder == (WPARAM)(-1))
return 1;
- PROTOACCOUNT *pa = Proto_GetAccount(szProto);
- if (pa == NULL || pa->ppro == NULL)
- return 1;
-
- if (pa->bOldProto)
- ret = CallProtoServiceInt(hContact, szProto, szProtoService, (WPARAM)(-1), (LPARAM)&ccs);
- else
- ret = CallProtoServiceInt(hContact, szProto, szProtoService, wParam, lParam);
- if (ret == CALLSERVICE_NOTFOUND)
- ret = 1;
-
- return ret;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-INT_PTR Proto_CallContactService(WPARAM wParam, LPARAM lParam)
-{
- CCSDATA *ccs = (CCSDATA*)lParam;
- INT_PTR ret;
-
- if (wParam == (WPARAM)(-1))
- return 1;
-
- for (int i = wParam; i < filters.getCount(); i++) {
- if ((ret = CallProtoServiceInt(NULL, filters[i]->szName, ccs->szProtoService, i + 1, lParam)) != CALLSERVICE_NOTFOUND) {
+ for (int i = iOrder; i < filters.getCount(); i++) {
+ if ((ret = CallProtoServiceInt(NULL, filters[i]->szName, ccs->szProtoService, i + 1, iOrder)) != CALLSERVICE_NOTFOUND) {
//chain was started, exit
return ret;
}
@@ -123,22 +89,33 @@ INT_PTR Proto_CallContactService(WPARAM wParam, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR Proto_RecvChain(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(INT_PTR) CallContactService(MCONTACT hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam)
+{
+ CCSDATA ccs = { hContact, szProtoService, wParam, lParam };
+ return Proto_ChainSend(0, &ccs);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_APP_DLL(INT_PTR) Proto_ChainRecv(int iOrder, CCSDATA *ccs)
{
- CCSDATA *ccs = (CCSDATA*)lParam;
INT_PTR ret;
- if (wParam == (WPARAM)(-1)) return 1; //shouldn't happen - sanity check
- if (wParam == 0) { //begin processing by finding end of chain
+ // shouldn't happen - sanity check
+ if (iOrder == -1)
+ return 1;
+
+ // begin processing by finding end of chain
+ if (iOrder == 0) {
if (GetCurrentThreadId() != hMainThreadId) // restart this function in the main thread
- return CallServiceSync(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(iOrder, ccs);
- wParam = filters.getCount();
+ iOrder = filters.getCount();
}
- else wParam--;
+ else iOrder--;
- for (int i = wParam - 1; i >= 0; i--)
- if ((ret = CallProtoServiceInt(NULL, filters[i]->szName, ccs->szProtoService, i + 1, lParam)) != CALLSERVICE_NOTFOUND)
+ for (int i = iOrder - 1; i >= 0; i--)
+ if ((ret = CallProtoServiceInt(NULL, filters[i]->szName, ccs->szProtoService, i + 1, (LPARAM)ccs)) != CALLSERVICE_NOTFOUND)
//chain was started, exit
return ret;
@@ -173,26 +150,25 @@ PROTOACCOUNT* __fastcall Proto_GetAccount(MCONTACT hContact) return Proto_GetAccount(szProto);
}
-static INT_PTR Proto_GetContactBaseProto(WPARAM wParam, LPARAM)
+MIR_APP_DLL(char*) GetContactProto(MCONTACT hContact)
{
- PROTOACCOUNT *pa = Proto_GetAccount(wParam);
- return (INT_PTR)(Proto_IsAccountEnabled(pa) ? pa->szModuleName : NULL);
+ PROTOACCOUNT *pa = Proto_GetAccount(hContact);
+ return Proto_IsAccountEnabled(pa) ? pa->szModuleName : NULL;
}
-static INT_PTR Proto_GetContactBaseAccount(WPARAM wParam, LPARAM)
+MIR_APP_DLL(char*) Proto_GetBaseAccountName(MCONTACT hContact)
{
- PROTOACCOUNT *pa = Proto_GetAccount(wParam);
- return (INT_PTR)(pa ? pa->szModuleName : NULL);
+ PROTOACCOUNT *pa = Proto_GetAccount(hContact);
+ return pa ? pa->szModuleName : NULL;
}
-static INT_PTR Proto_IsProtoOnContact(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(int) Proto_IsProtoOnContact(MCONTACT hContact, const char *szProto)
{
- char *szProto = (char*)lParam;
if (szProto == NULL)
return 0;
char szContactProto[40];
- if (!GetProtocolP(wParam, szContactProto, sizeof(szContactProto)))
+ if (!GetProtocolP(hContact, szContactProto, sizeof(szContactProto)))
if (!_stricmp(szProto, szContactProto))
return -1;
@@ -203,51 +179,32 @@ static INT_PTR Proto_IsProtoOnContact(WPARAM wParam, LPARAM lParam) return 0;
}
-static INT_PTR Proto_AddToContact(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(int) Proto_AddToContact(MCONTACT hContact, const char *szProto)
{
- char *szProto = (char*)lParam;
PROTOCOLDESCRIPTOR *pd = Proto_IsProtocolLoaded(szProto);
if (pd == NULL) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
- db_set_s(wParam, "Protocol", "p", szProto);
+ db_set_s(hContact, "Protocol", "p", szProto);
return 0;
}
return 1;
}
if (pd->type == PROTOTYPE_PROTOCOL || pd->type == PROTOTYPE_VIRTUAL)
- db_set_s(wParam, "Protocol", "p", szProto);
+ db_set_s(hContact, "Protocol", "p", szProto);
return 0;
}
-static INT_PTR Proto_RemoveFromContact(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(int) Proto_RemoveFromContact(MCONTACT hContact, const char *szProto)
{
- switch (Proto_IsProtoOnContact(wParam, lParam)) {
+ switch (Proto_IsProtoOnContact(hContact, szProto)) {
case 0:
return 1;
case -1:
- db_unset(wParam, "Protocol", "p");
- }
-
- return 0;
-}
-
-int LoadProtoChains(void)
-{
- if (!db_get_b(NULL, "Compatibility", "Filters", 0)) {
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)"_Filters");
- db_set_b(NULL, "Compatibility", "Filters", 1);
+ db_unset(hContact, "Protocol", "p");
}
- CreateServiceFunction(MS_PROTO_CALLCONTACTSERVICE, Proto_CallContactService);
- CreateServiceFunction(MS_PROTO_CHAINSEND, Proto_CallContactService);
- CreateServiceFunction(MS_PROTO_CHAINRECV, Proto_RecvChain);
- CreateServiceFunction(MS_PROTO_GETCONTACTBASEPROTO, Proto_GetContactBaseProto);
- CreateServiceFunction(MS_PROTO_GETCONTACTBASEACCOUNT, Proto_GetContactBaseAccount);
- CreateServiceFunction(MS_PROTO_ISPROTOONCONTACT, Proto_IsProtoOnContact);
- CreateServiceFunction(MS_PROTO_ADDTOCONTACT, Proto_AddToContact);
- CreateServiceFunction(MS_PROTO_REMOVEFROMCONTACT, Proto_RemoveFromContact);
return 0;
}
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 6d042b30cc..c34ffdc6d0 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -182,7 +182,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam {
PROTOCOLDESCRIPTOR **proto;
int protoCount, i, cnt = 0;
- CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&proto);
+ Proto_EnumProtocols(&protoCount, &proto);
for (i = 0; i < protoCount; i++) {
PROTOCOLDESCRIPTOR* pd = proto[i];
if (pd->type == PROTOTYPE_PROTOCOL && pd->cbSize == sizeof(*pd)) {
diff --git a/src/mir_app/src/proto_ui.cpp b/src/mir_app/src/proto_ui.cpp index b5cb6483eb..891ed883de 100644 --- a/src/mir_app/src/proto_ui.cpp +++ b/src/mir_app/src/proto_ui.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HINSTANCE ProtoGetInstance(const char *szModuleName)
{
- PROTOACCOUNT *pa = ProtoGetAccount(szModuleName);
+ PROTOACCOUNT *pa = Proto_GetAccount(szModuleName);
if (pa == NULL)
return NULL;
diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp index e69cb89891..0c2f053f8e 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -46,6 +46,14 @@ MIR_APP_DLL(PROTOCOLDESCRIPTOR*) Proto_IsProtocolLoaded(const char *szProtoName) /////////////////////////////////////////////////////////////////////////////////////////
+MIR_APP_DLL(void) Proto_EnumProtocols(int *nProtos, PROTOCOLDESCRIPTOR ***pProtos)
+{
+ if (nProtos) *nProtos = protos.getCount();
+ if (pProtos) *pProtos = protos.getArray();
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
MIR_APP_DLL(void) ProtoLogA(struct PROTO_INTERFACE *pThis, LPCSTR szFormat, va_list args)
{
char buf[4096];
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 8620c9ae50..6d9ee1b9e9 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-int LoadProtoChains(void);
int LoadProtoOptions(void);
HANDLE hAckEvent;
@@ -96,19 +95,16 @@ LIST<PROTOCOLDESCRIPTOR> filters(10, CompareProtos); void FreeFilesMatrix(TCHAR ***files);
-INT_PTR srvProto_IsLoaded(WPARAM, LPARAM lParam)
-{
- return (INT_PTR)Proto_IsProtocolLoaded((char*)lParam);
-}
-
static PROTO_INTERFACE* defInitProto(const char* szModule, const TCHAR*)
{
return AddDefaultAccount(szModule);
}
-static INT_PTR srvProto_RegisterModule(WPARAM, LPARAM lParam)
+MIR_APP_DLL(int) Proto_RegisterModule(PROTOCOLDESCRIPTOR *pd)
{
- PROTOCOLDESCRIPTOR *pd = (PROTOCOLDESCRIPTOR*)lParam;
+ if (pd == NULL)
+ return 1;
+
if (pd->cbSize != sizeof(PROTOCOLDESCRIPTOR) && pd->cbSize != PROTOCOLDESCRIPTOR_V3_SIZE)
return 1;
@@ -303,7 +299,7 @@ HICON Proto_GetIcon(PROTO_INTERFACE *ppro, int iconIndex) /////////////////////////////////////////////////////////////////////////////////////////
// 0.8.0+ - accounts
-PROTOACCOUNT* __fastcall Proto_GetAccount(const char* accName)
+MIR_APP_DLL(PROTOACCOUNT*) Proto_GetAccount(const char *accName)
{
if (accName == NULL)
return NULL;
@@ -331,49 +327,25 @@ static INT_PTR srvProto_CreateAccount(WPARAM, LPARAM lParam) return (INT_PTR)pa;
}
-static INT_PTR srvProto_GetAccount(WPARAM, LPARAM lParam)
+MIR_APP_DLL(void) Proto_EnumAccounts(int *nAccs, PROTOACCOUNT ***pAccs)
{
- return (INT_PTR)Proto_GetAccount((char*)lParam);
+ if (nAccs) *nAccs = accounts.getCount();
+ if (pAccs) *pAccs = accounts.getArray();
}
-static INT_PTR Proto_EnumAccounts(WPARAM wParam, LPARAM lParam)
-{
- *(int*)wParam = accounts.getCount();
- *(PROTOACCOUNT***)lParam = accounts.getArray();
- return 0;
-}
-
-bool __fastcall Proto_IsAccountEnabled(PROTOACCOUNT *pa)
+MIR_APP_DLL(bool) Proto_IsAccountEnabled(const PROTOACCOUNT *pa)
{
return pa && ((pa->bIsEnabled && !pa->bDynDisabled) || pa->bOldProto);
}
-static INT_PTR srvProto_IsAccountEnabled(WPARAM, LPARAM lParam)
-{
- return (INT_PTR)Proto_IsAccountEnabled((PROTOACCOUNT*)lParam);
-}
-
bool __fastcall Proto_IsAccountLocked(PROTOACCOUNT *pa)
{
return pa && db_get_b(NULL, pa->szModuleName, "LockMainStatus", 0) != 0;
}
-static INT_PTR srvProto_IsAccountLocked(WPARAM, LPARAM lParam)
-{
- return (INT_PTR)Proto_IsAccountLocked(Proto_GetAccount((char*)lParam));
-}
-
-static INT_PTR Proto_BroadcastAck(WPARAM, LPARAM lParam)
+MIR_APP_DLL(bool) Proto_IsAccountLocked(const char *pszModuleName)
{
- ACKDATA *ack = (ACKDATA*)lParam;
- return ProtoBroadcastAck(ack->szModule, ack->hContact, ack->type, ack->result, ack->hProcess, ack->lParam);
-}
-
-static INT_PTR Proto_EnumProtocols(WPARAM wParam, LPARAM lParam)
-{
- *(int*)wParam = protos.getCount();
- *(PROTOCOLDESCRIPTOR***)lParam = protos.getArray();
- return 0;
+ return Proto_IsAccountLocked(Proto_GetAccount(pszModuleName));
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -475,36 +447,31 @@ INT_PTR ProtoCallService(const char *szModule, const char *szService, WPARAM wPa /////////////////////////////////////////////////////////////////////////////////////////
+static INT_PTR srvProto_GetContactBaseAccount(WPARAM wParam, LPARAM)
+{
+ return (INT_PTR)Proto_GetBaseAccountName(wParam);
+}
+
int LoadProtocolsModule(void)
{
bModuleInitialized = TRUE;
- if (LoadProtoChains())
- return 1;
-
qsort(serviceItems, _countof(serviceItems), sizeof(serviceItems[0]), CompareServiceItems);
+ hAckEvent = CreateHookableEvent(ME_PROTO_ACK);
hTypeEvent = CreateHookableEvent(ME_PROTO_CONTACTISTYPING);
hAccListChanged = CreateHookableEvent(ME_PROTO_ACCLISTCHANGED);
- hAckEvent = CreateHookableEvent(ME_PROTO_ACK);
- CreateServiceFunction(MS_PROTO_ENUMPROTOS, Proto_EnumProtocols);
- CreateServiceFunction(MS_PROTO_BROADCASTACK, Proto_BroadcastAck);
- CreateServiceFunction(MS_PROTO_ISPROTOCOLLOADED, srvProto_IsLoaded);
- CreateServiceFunction(MS_PROTO_REGISTERMODULE, srvProto_RegisterModule);
CreateServiceFunction(MS_PROTO_SELFISTYPING, Proto_SelfIsTyping);
CreateServiceFunction(MS_PROTO_CONTACTISTYPING, Proto_ContactIsTyping);
CreateServiceFunction(MS_PROTO_RECVMSG, Proto_RecvMessage);
CreateServiceFunction(MS_PROTO_AUTHRECV, Proto_AuthRecv);
- CreateServiceFunction("Proto/EnumProtocols", Proto_EnumAccounts);
- CreateServiceFunction(MS_PROTO_ENUMACCOUNTS, Proto_EnumAccounts);
CreateServiceFunction(MS_PROTO_CREATEACCOUNT, srvProto_CreateAccount);
- CreateServiceFunction(MS_PROTO_GETACCOUNT, srvProto_GetAccount);
- CreateServiceFunction(MS_PROTO_ISACCOUNTENABLED, srvProto_IsAccountEnabled);
- CreateServiceFunction(MS_PROTO_ISACCOUNTLOCKED, srvProto_IsAccountLocked);
+ // just to make QuickSearch happy
+ CreateServiceFunction("Proto/GetContactBaseAccount", srvProto_GetContactBaseAccount);
return LoadProtoOptions();
}
diff --git a/src/mir_app/src/stdafx.h b/src/mir_app/src/stdafx.h index f4ffff15c9..b619bcf35a 100644 --- a/src/mir_app/src/stdafx.h +++ b/src/mir_app/src/stdafx.h @@ -72,7 +72,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_avatars.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_protoint.h>
#include <m_options.h>
|