diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-05-20 10:43:10 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-05-20 10:43:10 +0000 |
commit | 6e35b2b48d4a66598f594e641b7475b3df419b6e (patch) | |
tree | cdc4e223da2b04573407688b8f61a19d4a73e6b7 /protocols | |
parent | 4af188a3fb254479847f359bb777cf537b2d0462 (diff) |
Facebook: Fixed showing notifications without url.
git-svn-id: http://svn.miranda-ng.org/main/trunk@4758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 8 | ||||
-rw-r--r-- | protocols/FacebookRM/src/events.cpp | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/src/json.cpp | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 12 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.h | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index b332c48d8d..71a294b696 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -202,7 +202,7 @@ void FacebookProto::DeleteContactFromServer(void *data) db_set_dw(hContact, m_szModuleName, FACEBOOK_KEY_DELETED, ::time(NULL));
}
- NotifyEvent(m_tszUserName, TranslateT("Contact was removed from your server list."), NULL, FACEBOOK_EVENT_OTHER, NULL);
+ NotifyEvent(m_tszUserName, TranslateT("Contact was removed from your server list."), NULL, FACEBOOK_EVENT_OTHER);
} else {
facy.client_notify(TranslateT("Error occured when removing contact from server."));
}
@@ -242,7 +242,7 @@ void FacebookProto::AddContactToServer(void *data) db_set_b(hContact, m_szModuleName, FACEBOOK_KEY_CONTACT_TYPE, FACEBOOK_CONTACT_REQUEST);
}
- NotifyEvent(m_tszUserName, TranslateT("Request for friendship was sent."), NULL, FACEBOOK_EVENT_OTHER, NULL);
+ NotifyEvent(m_tszUserName, TranslateT("Request for friendship was sent."), NULL, FACEBOOK_EVENT_OTHER);
} else {
facy.client_notify(TranslateT("Error occured when requesting friendship."));
}
@@ -312,7 +312,7 @@ void FacebookProto::CancelFriendsRequest(void *data) if (resp.data.find("\"payload\":null", 0) != std::string::npos)
{
db_set_b(hContact, m_szModuleName, FACEBOOK_KEY_CONTACT_TYPE, FACEBOOK_CONTACT_NONE);
- NotifyEvent(m_tszUserName, TranslateT("Request for friendship was canceled."), NULL, FACEBOOK_EVENT_OTHER, NULL);
+ NotifyEvent(m_tszUserName, TranslateT("Request for friendship was canceled."), NULL, FACEBOOK_EVENT_OTHER);
} else {
facy.client_notify(TranslateT("Error occured when canceling friendship request."));
}
@@ -350,7 +350,7 @@ void FacebookProto::SendPokeWorker(void *p) utils::text::source_get_value(&resp.data, 3, "\"body\":", "__html\":\"", "\"}"))));
TCHAR* tmessage = mir_utf8decodeT(message.c_str());
- NotifyEvent(m_tszUserName, tmessage, NULL, FACEBOOK_EVENT_OTHER, NULL);
+ NotifyEvent(m_tszUserName, tmessage, NULL, FACEBOOK_EVENT_OTHER);
mir_free(tmessage);
}
diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp index 89a78842e6..bac8f5fb06 100644 --- a/protocols/FacebookRM/src/events.cpp +++ b/protocols/FacebookRM/src/events.cpp @@ -76,7 +76,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa return DefWindowProc(hwnd, message, wParam, lParam);
};
-void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, std::string szUrl)
+void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, std::string *url)
{
int ret; int timeout; COLORREF colorBack = 0; COLORREF colorText = 0;
@@ -144,8 +144,8 @@ void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD pd.iSeconds = timeout;
pd.lchContact = contact;
pd.lchIcon = Skin_GetIconByHandle(m_hProtoIcon); // TODO: Icon test
- if (!szUrl.empty())
- pd.PluginData = new popup_data(this, szUrl);
+ if (url != NULL)
+ pd.PluginData = new popup_data(this, *url);
pd.PluginWindowProc = (WNDPROC)PopupDlgProc;
lstrcpy(pd.lptzContactName, title);
lstrcpy(pd.lptzText, info);
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 18e84f6f81..2482819bf1 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -435,7 +435,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa TCHAR* szTitle = mir_utf8decodeT(title.c_str());
TCHAR* szText = mir_utf8decodeT(popup_text.c_str());
- proto->NotifyEvent(szTitle,szText,NULL,FACEBOOK_EVENT_OTHER, url);
+ proto->NotifyEvent(szTitle,szText,NULL,FACEBOOK_EVENT_OTHER, &url);
mir_free(szTitle);
mir_free(szText);
}
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 8bfe27d0ad..d9e26f7461 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -125,7 +125,7 @@ void FacebookProto::ProcessBuddyList(void* data) std::string url = FACEBOOK_URL_PROFILE + fbu->user_id;
TCHAR* szTitle = mir_utf8decodeT(fbu->real_name.c_str());
- NotifyEvent(szTitle, TranslateT("Contact is back on server-list."), fbu->handle, FACEBOOK_EVENT_OTHER, url);
+ NotifyEvent(szTitle, TranslateT("Contact is back on server-list."), fbu->handle, FACEBOOK_EVENT_OTHER, &url);
mir_free(szTitle);
}
@@ -214,7 +214,7 @@ void FacebookProto::ProcessFriendList(void* data) std::string url = FACEBOOK_URL_PROFILE + fbu->user_id;
TCHAR* szTitle = mir_utf8decodeT(fbu->real_name.c_str());
- NotifyEvent(szTitle, TranslateT("Contact is back on server-list."), hContact, FACEBOOK_EVENT_OTHER, url);
+ NotifyEvent(szTitle, TranslateT("Contact is back on server-list."), hContact, FACEBOOK_EVENT_OTHER, &url);
mir_free(szTitle);
}
@@ -243,7 +243,7 @@ void FacebookProto::ProcessFriendList(void* data) std::string url = FACEBOOK_URL_PROFILE + id;
TCHAR* szTitle = mir_utf8decodeT(contactname.c_str());
- NotifyEvent(szTitle, TranslateT("Contact is no longer on server-list."), hContact, FACEBOOK_EVENT_OTHER, url);
+ NotifyEvent(szTitle, TranslateT("Contact is no longer on server-list."), hContact, FACEBOOK_EVENT_OTHER, &url);
mir_free(szTitle);
}
}
@@ -493,7 +493,7 @@ void FacebookProto::ProcessMessages(void* data) LOG(" Got notification: %s", notifications[i]->text.c_str());
TCHAR* szTitle = mir_utf8decodeT(this->m_szModuleName);
TCHAR* szText = mir_utf8decodeT(notifications[i]->text.c_str());
- NotifyEvent(szTitle, szText, ContactIDToHContact(notifications[i]->user_id), FACEBOOK_EVENT_NOTIFICATION, notifications[i]->link);
+ NotifyEvent(szTitle, szText, ContactIDToHContact(notifications[i]->user_id), FACEBOOK_EVENT_NOTIFICATION, ¬ifications[i]->link);
mir_free(szTitle);
mir_free(szText);
@@ -551,7 +551,7 @@ void FacebookProto::ProcessNotifications(void*) LOG(" Got notification: %s", notifications[i]->text.c_str());
TCHAR* szTitle = mir_utf8decodeT(this->m_szModuleName);
TCHAR* szText = mir_utf8decodeT(notifications[i]->text.c_str());
- NotifyEvent(szTitle, szText, ContactIDToHContact(notifications[i]->user_id), FACEBOOK_EVENT_NOTIFICATION, notifications[i]->link);
+ NotifyEvent(szTitle, szText, ContactIDToHContact(notifications[i]->user_id), FACEBOOK_EVENT_NOTIFICATION, ¬ifications[i]->link);
mir_free(szTitle);
mir_free(szText);
@@ -745,7 +745,7 @@ void FacebookProto::ProcessFeeds(void* data) LOG(" Got newsfeed: %s %s", news[i]->title.c_str(), news[i]->text.c_str());
TCHAR* szTitle = mir_utf8decodeT(news[i]->title.c_str());
TCHAR* szText = mir_utf8decodeT(news[i]->text.c_str());
- NotifyEvent(szTitle,szText,this->ContactIDToHContact(news[i]->user_id),FACEBOOK_EVENT_NEWSFEED, news[i]->link);
+ NotifyEvent(szTitle,szText,this->ContactIDToHContact(news[i]->user_id),FACEBOOK_EVENT_NEWSFEED, &news[i]->link);
mir_free(szTitle);
mir_free(szText);
delete news[i];
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index 4032d10438..877c2a35da 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -209,5 +209,5 @@ public: // Information providing
int Log(const char *fmt,...);
- void NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, std::string url = "");
+ void NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, std::string *url = NULL);
};
|