diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
commit | 78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch) | |
tree | 8512c50df70b8dd80c919e88ade3419207c95956 /protocols/FacebookRM | |
parent | ce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff) |
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/chat.cpp | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/contacts.cpp | 18 | ||||
-rw-r--r-- | protocols/FacebookRM/dialogs.cpp | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/messages.cpp | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/process.cpp | 4 | ||||
-rw-r--r-- | protocols/FacebookRM/proto.cpp | 8 | ||||
-rw-r--r-- | protocols/FacebookRM/theme.cpp | 4 |
7 files changed, 24 insertions, 24 deletions
diff --git a/protocols/FacebookRM/chat.cpp b/protocols/FacebookRM/chat.cpp index 5fc0c8ac6e..2b66e730a1 100644 --- a/protocols/FacebookRM/chat.cpp +++ b/protocols/FacebookRM/chat.cpp @@ -266,7 +266,7 @@ int FacebookProto::OnJoinChat(WPARAM,LPARAM suppress) SetTopic("Omegle is a great way of meeting new friends!");
// Note: Initialization will finish up in SetChatStatus, called separately
- if(!suppress)
+ if (!suppress)
SetChatStatus(m_iStatus);
*/
return 0;
diff --git a/protocols/FacebookRM/contacts.cpp b/protocols/FacebookRM/contacts.cpp index 23a6ca4455..d9acefa076 100644 --- a/protocols/FacebookRM/contacts.cpp +++ b/protocols/FacebookRM/contacts.cpp @@ -27,9 +27,9 @@ bool FacebookProto::IsMyContact(HANDLE hContact, bool include_chat) const char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
reinterpret_cast<WPARAM>(hContact),0) );
- if( proto && strcmp(m_szModuleName,proto) == 0 )
+ if ( proto && strcmp(m_szModuleName,proto) == 0 )
{
- if( include_chat )
+ if ( include_chat )
return true;
else
return DBGetContactSettingByte(hContact,m_szModuleName,"ChatRoom",0) == 0;
@@ -44,13 +44,13 @@ HANDLE FacebookProto::ContactIDToHContact(std::string user_id) hContact;
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0) )
{
- if(!IsMyContact(hContact))
+ if (!IsMyContact(hContact))
continue;
DBVARIANT dbv;
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
- if( strcmp(user_id.c_str(),dbv.pszVal) == 0 )
+ if ( strcmp(user_id.c_str(),dbv.pszVal) == 0 )
{
DBFreeVariant(&dbv);
return hContact;
@@ -70,15 +70,15 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, BYTE type, bool dont_ if (!dont_check) {
// First, check if this contact exists
hContact = ContactIDToHContact(fbu->user_id);
- if( hContact )
+ if ( hContact )
return hContact;
}
// If not, make a new contact!
hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
- if( hContact )
+ if ( hContact )
{
- if( CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0 )
+ if ( CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0 )
{
DBWriteContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,fbu->user_id.c_str());
@@ -90,7 +90,7 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, BYTE type, bool dont_ DBDeleteContactSetting(hContact, "CList", "MyHandle");
DBVARIANT dbv;
- if( !DBGetContactSettingTString(NULL,m_szModuleName,FACEBOOK_KEY_DEF_GROUP,&dbv) )
+ if ( !DBGetContactSettingTString(NULL,m_szModuleName,FACEBOOK_KEY_DEF_GROUP,&dbv) )
{
DBWriteContactSettingTString(hContact,"CList","Group",dbv.ptszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/FacebookRM/dialogs.cpp b/protocols/FacebookRM/dialogs.cpp index 721ef35905..da897e0073 100644 --- a/protocols/FacebookRM/dialogs.cpp +++ b/protocols/FacebookRM/dialogs.cpp @@ -50,7 +50,7 @@ INT_PTR CALLBACK FBAccountProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM l SetWindowLong(hwnd,GWLP_USERDATA,lparam);
DBVARIANT dbv;
- if( !DBGetContactSettingString(0,proto->ModuleName(),FACEBOOK_KEY_LOGIN,&dbv) )
+ if ( !DBGetContactSettingString(0,proto->ModuleName(),FACEBOOK_KEY_LOGIN,&dbv) )
{
SetDlgItemTextA(hwnd,IDC_UN,dbv.pszVal);
DBFreeVariant(&dbv);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK FBOptionsProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM l SetWindowLong(hwnd,GWLP_USERDATA,lparam);
DBVARIANT dbv;
- if( !DBGetContactSettingString(0,proto->ModuleName(),FACEBOOK_KEY_LOGIN,&dbv) )
+ if ( !DBGetContactSettingString(0,proto->ModuleName(),FACEBOOK_KEY_LOGIN,&dbv) )
{
SetDlgItemTextA(hwnd,IDC_UN,dbv.pszVal);
DBFreeVariant(&dbv);
@@ -216,7 +216,7 @@ INT_PTR CALLBACK FBOptionsProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM l SendDlgItemMessage(hwnd, IDC_GROUP, EM_LIMITTEXT, FACEBOOK_GROUP_NAME_LIMIT, 0);
- if( !DBGetContactSettingTString(0,proto->ModuleName(),FACEBOOK_KEY_DEF_GROUP,&dbv) )
+ if ( !DBGetContactSettingTString(0,proto->ModuleName(),FACEBOOK_KEY_DEF_GROUP,&dbv) )
{
SetDlgItemText(hwnd,IDC_GROUP,dbv.ptszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/FacebookRM/messages.cpp b/protocols/FacebookRM/messages.cpp index 072ae88b4f..9725ec40c9 100644 --- a/protocols/FacebookRM/messages.cpp +++ b/protocols/FacebookRM/messages.cpp @@ -26,7 +26,7 @@ int FacebookProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre) {
DBVARIANT dbv;
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
ForkThread( &FacebookProto::MessagingWorker, this, new send_messaging(dbv.pszVal, FACEBOOK_RECV_MESSAGE ) );
DBFreeVariant(&dbv);
@@ -53,7 +53,7 @@ void FacebookProto::SendMsgWorker(void *p) {
ProtoBroadcastAck(m_szModuleName, data->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, data->msgid, (LPARAM)Translate("You cannot send messages when you are offline."));
}
- else if( !DBGetContactSettingString(data->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ else if ( !DBGetContactSettingString(data->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
int retries = 5;
std::string error_text = "";
@@ -130,7 +130,7 @@ void FacebookProto::SendTypingWorker(void *p) }
DBVARIANT dbv;
- if( !DBGetContactSettingString(typing->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(typing->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
std::string data = "typ=";
data += ( typing->status == PROTOTYPE_SELFTYPING_ON ) ? "1" : "0"; // PROTOTYPE_SELFTYPING_OFF
diff --git a/protocols/FacebookRM/process.cpp b/protocols/FacebookRM/process.cpp index 056b8115dc..e63d186fb3 100644 --- a/protocols/FacebookRM/process.cpp +++ b/protocols/FacebookRM/process.cpp @@ -133,12 +133,12 @@ void FacebookProto::ProcessFriendList( void* data ) hContact;
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0) )
{
- if(!IsMyContact(hContact))
+ if (!IsMyContact(hContact))
continue;
DBVARIANT dbv;
facebook_user *fbu;
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) ) {
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) ) {
std::string id = dbv.pszVal;
DBFreeVariant(&dbv);
diff --git a/protocols/FacebookRM/proto.cpp b/protocols/FacebookRM/proto.cpp index 820a1c3fb6..992977b372 100644 --- a/protocols/FacebookRM/proto.cpp +++ b/protocols/FacebookRM/proto.cpp @@ -456,7 +456,7 @@ int FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam) HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
DBVARIANT dbv;
- if( wParam != 0 && !DBGetContactSettingString(hContact,m_szModuleName,"Homepage",&dbv) )
+ if ( wParam != 0 && !DBGetContactSettingString(hContact,m_szModuleName,"Homepage",&dbv) )
{
CallService(MS_UTILS_OPENURL,1,reinterpret_cast<LPARAM>(dbv.pszVal));
DBFreeVariant(&dbv);
@@ -497,7 +497,7 @@ int FacebookProto::CancelFriendship(WPARAM wParam,LPARAM lParam) if ( !DBGetContactSettingUTF8String(hContact, m_szModuleName, FACEBOOK_KEY_NAME, &dbv) ) {
mir_snprintf(str,SIZEOF(str),Translate("Do you want to cancel your friendship with '%s'?"), dbv.pszVal);
DBFreeVariant(&dbv);
- } else if( !DBGetContactSettingUTF8String(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) ) {
+ } else if ( !DBGetContactSettingUTF8String(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) ) {
mir_snprintf(str,SIZEOF(str),Translate("Do you want to cancel your friendship with '%s'?"), dbv.pszVal);
DBFreeVariant(&dbv);
}
@@ -505,7 +505,7 @@ int FacebookProto::CancelFriendship(WPARAM wParam,LPARAM lParam) TCHAR *text = mir_a2t_cp(str, CP_UTF8);
if (MessageBox( 0, text, m_tszUserName, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2 ) == IDYES) {
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
std::string* id = new std::string(dbv.pszVal);
@@ -534,7 +534,7 @@ int FacebookProto::RequestFriendship(WPARAM wParam,LPARAM lParam) HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
DBVARIANT dbv;
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
std::string* id = new std::string(dbv.pszVal);
ForkThread( &FacebookProto::AddContactToServer, this, ( void* )id );
diff --git a/protocols/FacebookRM/theme.cpp b/protocols/FacebookRM/theme.cpp index fd8d0be032..88e0ab5498 100644 --- a/protocols/FacebookRM/theme.cpp +++ b/protocols/FacebookRM/theme.cpp @@ -118,11 +118,11 @@ static FacebookProto * GetInstanceByHContact(HANDLE hContact) {
char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
reinterpret_cast<WPARAM>(hContact),0) );
- if(!proto)
+ if (!proto)
return 0;
for(int i=0; i<g_Instances.getCount(); i++)
- if(!strcmp(proto,g_Instances[i].m_szModuleName))
+ if (!strcmp(proto,g_Instances[i].m_szModuleName))
return &g_Instances[i];
return 0;
|