summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /protocols/FacebookRM/src
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r--protocols/FacebookRM/src/avatars.cpp8
-rw-r--r--protocols/FacebookRM/src/captcha.cpp6
-rw-r--r--protocols/FacebookRM/src/chat.cpp16
-rw-r--r--protocols/FacebookRM/src/communication.cpp24
-rw-r--r--protocols/FacebookRM/src/connection.cpp40
-rw-r--r--protocols/FacebookRM/src/contacts.cpp22
-rw-r--r--protocols/FacebookRM/src/dialogs.cpp8
-rw-r--r--protocols/FacebookRM/src/events.cpp18
-rw-r--r--protocols/FacebookRM/src/json.cpp10
-rw-r--r--protocols/FacebookRM/src/main.cpp2
-rw-r--r--protocols/FacebookRM/src/messages.cpp12
-rw-r--r--protocols/FacebookRM/src/process.cpp28
-rw-r--r--protocols/FacebookRM/src/proto.cpp54
-rw-r--r--protocols/FacebookRM/src/theme.cpp6
14 files changed, 127 insertions, 127 deletions
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index da7be52e72..41e3c5d341 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -80,13 +80,13 @@ void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &imag
}
else if (update_required) {
db_set_b(hContact, "ContactPhoto", "NeedUpdate", 1);
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, nullptr);
}
}
void FacebookProto::UpdateAvatarWorker(void *)
{
- HNETLIBCONN nlc = NULL;
+ HNETLIBCONN nlc = nullptr;
debugLogA("*** UpdateAvatarWorker");
@@ -178,7 +178,7 @@ INT_PTR FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
return GAIR_NOAVATAR;
PROTO_AVATAR_INFORMATION* pai = (PROTO_AVATAR_INFORMATION*)lParam;
- if (GetDbAvatarInfo(*pai, NULL))
+ if (GetDbAvatarInfo(*pai, nullptr))
{
bool fileExist = _waccess(pai->filename, 0) == 0;
@@ -198,7 +198,7 @@ INT_PTR FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
bool is_empty = avatar_queue.empty();
avatar_queue.push_back(pai->hContact);
if (is_empty)
- ForkThread(&FacebookProto::UpdateAvatarWorker, NULL);
+ ForkThread(&FacebookProto::UpdateAvatarWorker, nullptr);
}
return GAIR_WAITFOR;
}
diff --git a/protocols/FacebookRM/src/captcha.cpp b/protocols/FacebookRM/src/captcha.cpp
index 8e65cf6374..6f09eeaae9 100644
--- a/protocols/FacebookRM/src/captcha.cpp
+++ b/protocols/FacebookRM/src/captcha.cpp
@@ -111,7 +111,7 @@ bool FacebookProto::RunCaptchaForm(std::string captchaUrl, std::string &result)
req.flags = NLHRF_NODUMPHEADERS;
NETLIBHTTPREQUEST *reply = Netlib_HttpTransaction(facy.handle_, &req);
- if (reply == NULL)
+ if (reply == nullptr)
return false;
if (reply->resultCode != HTTP_CODE_OK) {
@@ -119,7 +119,7 @@ bool FacebookProto::RunCaptchaForm(std::string captchaUrl, std::string &result)
return false;
}
- CAPTCHA_FORM_PARAMS param = { 0 };
+ CAPTCHA_FORM_PARAMS param = {};
IMGSRVC_MEMIO memio = { 0 };
memio.iLen = reply->dataLength;
@@ -131,7 +131,7 @@ bool FacebookProto::RunCaptchaForm(std::string captchaUrl, std::string &result)
GetObject(param.bmp, sizeof(bmp), &bmp);
param.w = bmp.bmWidth;
param.h = bmp.bmHeight;
- int res = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CAPTCHAFORM), NULL, CaptchaFormDlgProc, (LPARAM)&param);
+ int res = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CAPTCHAFORM), nullptr, CaptchaFormDlgProc, (LPARAM)&param);
if (res == 0)
return false;
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp
index 966a7a0d76..3d35fb179f 100644
--- a/protocols/FacebookRM/src/chat.cpp
+++ b/protocols/FacebookRM/src/chat.cpp
@@ -37,8 +37,8 @@ void FacebookProto::UpdateChat(const char *chat_id, const char *id, const char *
GCEVENT gce = { m_szModuleName, tchat_id, GC_EVENT_MESSAGE };
gce.ptszText = ttext;
- gce.time = timestamp ? timestamp : ::time(NULL);
- if (id != NULL)
+ gce.time = timestamp ? timestamp : ::time(nullptr);
+ if (id != nullptr)
gce.bIsMe = !mir_strcmp(id, facy.self_.user_id.c_str());
gce.dwFlags |= GCEF_ADDTOLOG;
if (is_old) {
@@ -172,7 +172,7 @@ void FacebookProto::AddChatContact(const char *chat_id, const chatroom_participa
gce.dwFlags = addToLog ? GCEF_ADDTOLOG : 0;
gce.ptszNick = tnick;
gce.ptszUID = tid;
- gce.time = ::time(NULL);
+ gce.time = ::time(nullptr);
gce.bIsMe = (user.role == ROLE_ME);
if (user.is_former) {
@@ -209,7 +209,7 @@ void FacebookProto::RemoveChatContact(const char *chat_id, const char *id, const
gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszNick = tnick;
gce.ptszUID = tid;
- gce.time = ::time(NULL);
+ gce.time = ::time(nullptr);
gce.bIsMe = false;
Chat_Event(&gce);
@@ -233,7 +233,7 @@ char *FacebookProto::GetChatUsers(const char *chat_id)
bool FacebookProto::IsChatContact(const char *chat_id, const char *id)
{
ptrA users(GetChatUsers(chat_id));
- return (users != NULL && strstr(users, id) != NULL);
+ return (users != NULL && strstr(users, id) != nullptr);
}
void FacebookProto::AddChat(const char *id, const wchar_t *tname)
@@ -308,7 +308,7 @@ INT_PTR FacebookProto::OnJoinChat(WPARAM hContact, LPARAM)
INT_PTR FacebookProto::OnLeaveChat(WPARAM wParam, LPARAM)
{
- ptrW idT(wParam ? getWStringA(wParam, "ChatRoomID") : NULL);
+ ptrW idT(wParam ? getWStringA(wParam, "ChatRoomID") : nullptr);
Chat_Control(m_szModuleName, idT, SESSION_OFFLINE);
Chat_Terminate(m_szModuleName, idT);
@@ -335,7 +335,7 @@ int FacebookProto::OnGCMenuHook(WPARAM, LPARAM lParam)
{
GCMENUITEMS *gcmi = (GCMENUITEMS*)lParam;
- if (gcmi == NULL || _stricmp(gcmi->pszModule, m_szModuleName)) return 0;
+ if (gcmi == nullptr || _stricmp(gcmi->pszModule, m_szModuleName)) return 0;
if (gcmi->Type == MENU_ON_LOG)
{
@@ -416,7 +416,7 @@ void FacebookProto::UpdateNotificationsChatRoom(facebook_notification *notificat
GCEVENT gce = { m_szModuleName, _A2W(FACEBOOK_NOTIFICATIONS_CHATROOM), GC_EVENT_MESSAGE };
gce.ptszText = messageT;
- gce.time = notification->time ? notification->time : ::time(NULL);
+ gce.time = notification->time ? notification->time : ::time(nullptr);
gce.bIsMe = false;
gce.dwFlags |= GCEF_ADDTOLOG;
gce.ptszNick = TranslateT("Notifications");
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 514ab9ccef..7d41c10e2e 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -42,7 +42,7 @@ http::response facebook_client::sendRequest(HttpRequest *request)
}
// Check and append user defined locale if request doesn't have it forced already
- if (!parent->m_locale.empty() && strstr(request->szUrl, "&locale=") == NULL)
+ if (!parent->m_locale.empty() && strstr(request->szUrl, "&locale=") == nullptr)
request->Url << CHAR_VALUE("locale", parent->m_locale.c_str());
request->Headers
@@ -68,7 +68,7 @@ http::response facebook_client::sendRequest(HttpRequest *request)
// Set persistent connection (or not)
switch (request->Persistent) {
case ChannelRequest::NONE:
- request->nlc = NULL;
+ request->nlc = nullptr;
request->flags &= ~NLHRF_PERSISTENT;
break;
case ChannelRequest::CHANNEL:
@@ -96,19 +96,19 @@ http::response facebook_client::sendRequest(HttpRequest *request)
case ChannelRequest::NONE:
break;
case ChannelRequest::CHANNEL:
- hChannelCon = pnlhr ? pnlhr->nlc : NULL;
+ hChannelCon = pnlhr ? pnlhr->nlc : nullptr;
break;
case ChannelRequest::MESSAGES:
- hMessagesCon = pnlhr ? pnlhr->nlc : NULL;
+ hMessagesCon = pnlhr ? pnlhr->nlc : nullptr;
break;
case ChannelRequest::DEFAULT:
ReleaseMutex(fcb_conn_lock_);
- hFcbCon = pnlhr ? pnlhr->nlc : NULL;
+ hFcbCon = pnlhr ? pnlhr->nlc : nullptr;
break;
}
// Check and copy response data
- if (pnlhr != NULL) {
+ if (pnlhr != nullptr) {
parent->debugLogA("@@@ Got response with code %d", pnlhr->resultCode);
store_headers(&resp, pnlhr->headers, pnlhr->headersCount);
resp.code = pnlhr->resultCode;
@@ -293,7 +293,7 @@ void facebook_client::clear_notifications()
ScopedLock s(notifications_lock_);
for (auto it = notifications.begin(); it != notifications.end();) {
- if (it->second->hWndPopup != NULL)
+ if (it->second->hWndPopup != nullptr)
PUDeletePopup(it->second->hWndPopup); // close popup
delete it->second;
@@ -570,7 +570,7 @@ bool facebook_client::login(const char *username, const char *password)
tszMessage.AppendFormat(L"\n\n%s", ptrW(mir_utf8decodeW(activity.c_str())));
}
- if (MessageBox(0, tszMessage, tszTitle, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON1) != IDYES) {
+ if (MessageBox(nullptr, tszMessage, tszTitle, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON1) != IDYES) {
// We will cancel connecting right away, because we don't want to handle password changing via Miranda
client_notify(TranslateT("Login error: You need to confirm last unknown login or revoke it from web browser."));
return handle_error("login", FORCE_QUIT);
@@ -1007,7 +1007,7 @@ bool facebook_client::activity_ping()
http::response resp = sendRequest(request);
// Remember this last ping time
- parent->m_pingTS = ::time(NULL);
+ parent->m_pingTS = ::time(nullptr);
if (resp.data.empty() || resp.data.find("\"t\":\"pong\"") == resp.data.npos) {
// Something went wrong
@@ -1143,7 +1143,7 @@ int facebook_client::send_message(int seqid, MCONTACT hContact, const std::strin
bool facebook_client::post_status(status_data *status)
{
- if (status == NULL || (status->text.empty() && status->url.empty()))
+ if (status == nullptr || (status->text.empty() && status->url.empty()))
return false;
handle_entry("post_status");
@@ -1213,7 +1213,7 @@ bool facebook_client::save_url(const std::string &url, const std::wstring &filen
// Write to file
FILE *f = _wfopen(filename.c_str(), L"wb");
- if (f != NULL) {
+ if (f != nullptr) {
fwrite(resp->pData, 1, resp->dataLength, f);
fclose(f);
@@ -1223,7 +1223,7 @@ bool facebook_client::save_url(const std::string &url, const std::wstring &filen
Netlib_FreeHttpRequest(resp);
}
else {
- nlc = NULL;
+ nlc = nullptr;
}
return ret;
diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp
index 613e25427f..80d4b6e95a 100644
--- a/protocols/FacebookRM/src/connection.cpp
+++ b/protocols/FacebookRM/src/connection.cpp
@@ -40,13 +40,13 @@ void FacebookProto::ChangeStatus(void*)
Netlib_Shutdown(facy.hChannelCon);
if (facy.hChannelCon)
Netlib_CloseHandle(facy.hChannelCon);
- facy.hChannelCon = NULL;
+ facy.hChannelCon = nullptr;
// Shutdown and close messages handle
Netlib_Shutdown(facy.hMessagesCon);
if (facy.hMessagesCon)
Netlib_CloseHandle(facy.hMessagesCon);
- facy.hMessagesCon = NULL;
+ facy.hMessagesCon = nullptr;
// Turn off chat on Facebook
if (getByte(FACEBOOK_KEY_DISCONNECT_CHAT, DEFAULT_DISCONNECT_CHAT))
@@ -84,7 +84,7 @@ void FacebookProto::ChangeStatus(void*)
// Close connection handle
if (facy.hFcbCon)
Netlib_CloseHandle(facy.hFcbCon);
- facy.hFcbCon = NULL;
+ facy.hFcbCon = nullptr;
m_iStatus = facy.self_.status_id = ID_STATUS_OFFLINE;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
@@ -115,38 +115,38 @@ void FacebookProto::ChangeStatus(void*)
if (NegotiateConnection() && facy.home() && facy.reconnect())
{
// Load all friends
- ProcessFriendList(NULL);
+ ProcessFriendList(nullptr);
// Process friendship requests
- ForkThread(&FacebookProto::ProcessFriendRequests, NULL);
+ ForkThread(&FacebookProto::ProcessFriendRequests, nullptr);
// Get unread messages
- ForkThread(&FacebookProto::ProcessUnreadMessages, NULL);
+ ForkThread(&FacebookProto::ProcessUnreadMessages, nullptr);
// Get notifications
if (getByte(FACEBOOK_KEY_EVENT_NOTIFICATIONS_ENABLE, DEFAULT_EVENT_NOTIFICATIONS_ENABLE))
- ForkThread(&FacebookProto::ProcessNotifications, NULL);
+ ForkThread(&FacebookProto::ProcessNotifications, nullptr);
// Load pages for post status dialog
- ForkThread(&FacebookProto::ProcessPages, NULL);
+ ForkThread(&FacebookProto::ProcessPages, nullptr);
// Load on this day posts
if (getByte(FACEBOOK_KEY_EVENT_ON_THIS_DAY_ENABLE, DEFAULT_EVENT_ON_THIS_DAY_ENABLE))
- ForkThread(&FacebookProto::ProcessMemories, NULL);
+ ForkThread(&FacebookProto::ProcessMemories, nullptr);
- setDword(FACEBOOK_KEY_LOGON_TS, (DWORD)time(NULL));
- ForkThread(&FacebookProto::UpdateLoop, NULL);
- ForkThread(&FacebookProto::MessageLoop, NULL);
+ setDword(FACEBOOK_KEY_LOGON_TS, (DWORD)time(nullptr));
+ ForkThread(&FacebookProto::UpdateLoop, nullptr);
+ ForkThread(&FacebookProto::MessageLoop, nullptr);
if (getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS, DEFAULT_SET_MIRANDA_STATUS))
- ForkThread(&FacebookProto::SetAwayMsgWorker, NULL);
+ ForkThread(&FacebookProto::SetAwayMsgWorker, nullptr);
}
else {
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_FAILED, (HANDLE)old_status, m_iStatus);
if (facy.hFcbCon)
Netlib_CloseHandle(facy.hFcbCon);
- facy.hFcbCon = NULL;
+ facy.hFcbCon = nullptr;
facy.clear_cookies();
@@ -181,7 +181,7 @@ void FacebookProto::ChangeStatus(void*)
bool isAwayOrInvisible = (new_status == ID_STATUS_AWAY || new_status == ID_STATUS_INVISIBLE);
if (!wasAwayOrInvisible && isAwayOrInvisible) {
// Switching from "not-away" to "away" state, remember timestamp of this change (and if we are idle already, use the idle time)
- m_awayTS = (m_idleTS > 0 ? m_idleTS : ::time(NULL));
+ m_awayTS = (m_idleTS > 0 ? m_idleTS : ::time(nullptr));
}
else if (wasAwayOrInvisible && !isAwayOrInvisible) {
// Switching from "away" to "not-away" state, reset the timestamp
@@ -217,7 +217,7 @@ bool FacebookProto::NegotiateConnection()
password = mir_utf8encode(password);
// Refresh last time of feeds update
- facy.last_feeds_update_ = ::time(NULL);
+ facy.last_feeds_update_ = ::time(nullptr);
// Generate random clientid for this connection
facy.chat_clientid_ = utils::text::rand_string(8, "0123456789abcdef", &facy.random_);
@@ -231,14 +231,14 @@ bool FacebookProto::NegotiateConnection()
void FacebookProto::UpdateLoop(void *)
{
- time_t tim = ::time(NULL);
+ time_t tim = ::time(nullptr);
debugLogA(">>> Entering Facebook::UpdateLoop[%d]", tim);
for (int i = -1; !isOffline(); i = (i + 1) % 50)
{
if (i != -1) {
if (getByte(FACEBOOK_KEY_EVENT_FEEDS_ENABLE, DEFAULT_EVENT_FEEDS_ENABLE))
- ProcessFeeds(NULL);
+ ProcessFeeds(nullptr);
}
debugLogA("*** FacebookProto::UpdateLoop[%d] going to sleep...", tim);
@@ -253,7 +253,7 @@ void FacebookProto::UpdateLoop(void *)
void FacebookProto::MessageLoop(void *)
{
- time_t tim = ::time(NULL);
+ time_t tim = ::time(nullptr);
debugLogA(">>> Entering Facebook::MessageLoop[%d]", tim);
while (facy.channel())
@@ -262,7 +262,7 @@ void FacebookProto::MessageLoop(void *)
break;
// If we're not idle, send activity_ping every few minutes...
- if (!m_idleTS && (::time(NULL) - m_pingTS) > FACEBOOK_PING_TIME) {
+ if (!m_idleTS && (::time(nullptr) - m_pingTS) > FACEBOOK_PING_TIME) {
debugLogA("*** FacebookProto::MessageLoop[%d] pinging...", tim);
facy.activity_ping();
}
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 3433941bca..75b7e7de68 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -410,7 +410,7 @@ void FacebookProto::DeleteContactFromServer(void *data)
{
facy.handle_entry("DeleteContactFromServer");
- if (data == NULL)
+ if (data == nullptr)
return;
std::string id = *(std::string*)data;
@@ -436,7 +436,7 @@ void FacebookProto::DeleteContactFromServer(void *data)
if (hContact != NULL) {
setWord(hContact, "Status", ID_STATUS_OFFLINE);
setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_NONE);
- setDword(hContact, FACEBOOK_KEY_DELETED, ::time(NULL));
+ setDword(hContact, FACEBOOK_KEY_DELETED, ::time(nullptr));
}
NotifyEvent(m_tszUserName, TranslateT("Contact was removed from your server list."), NULL, EVENT_FRIENDSHIP);
@@ -453,7 +453,7 @@ void FacebookProto::AddContactToServer(void *data)
{
facy.handle_entry("AddContactToServer");
- if (data == NULL)
+ if (data == nullptr)
return;
std::string id = *(std::string*)data;
@@ -485,7 +485,7 @@ void FacebookProto::ApproveContactToServer(void *data)
{
facy.handle_entry("ApproveContactToServer");
- if (data == NULL)
+ if (data == nullptr)
return;
MCONTACT hContact = *(MCONTACT*)data;
@@ -517,7 +517,7 @@ void FacebookProto::CancelFriendsRequest(void *data)
{
facy.handle_entry("CancelFriendsRequest");
- if (data == NULL)
+ if (data == nullptr)
return;
MCONTACT hContact = *(MCONTACT*)data;
@@ -549,7 +549,7 @@ void FacebookProto::IgnoreFriendshipRequest(void *data)
{
facy.handle_entry("IgnoreFriendshipRequest");
- if (data == NULL)
+ if (data == nullptr)
return;
MCONTACT hContact = *(MCONTACT*)data;
@@ -585,7 +585,7 @@ void FacebookProto::SendPokeWorker(void *p)
{
facy.handle_entry("SendPokeWorker");
- if (p == NULL)
+ if (p == nullptr)
return;
std::string *id = (std::string*)p;
@@ -622,7 +622,7 @@ void FacebookProto::SendPokeWorker(void *p)
void FacebookProto::RefreshUserInfo(void *data)
{
- if (data == NULL)
+ if (data == nullptr)
return;
MCONTACT hContact = *(MCONTACT*)data;
@@ -630,7 +630,7 @@ void FacebookProto::RefreshUserInfo(void *data)
ptrA user_id(getStringA(hContact, FACEBOOK_KEY_ID));
if (user_id == NULL || isOffline()) {
- ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)0, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)nullptr, 0);
return;
}
@@ -700,13 +700,13 @@ void FacebookProto::RefreshUserInfo(void *data)
}
}
- ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)0, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)nullptr, 0);
}
HANDLE FacebookProto::GetAwayMsg(MCONTACT)
{
- return 0; // Status messages are disabled
+ return nullptr; // Status messages are disabled
}
int FacebookProto::OnContactDeleted(WPARAM wParam, LPARAM)
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp
index 8874d141bf..d35042b74a 100644
--- a/protocols/FacebookRM/src/dialogs.cpp
+++ b/protocols/FacebookRM/src/dialogs.cpp
@@ -174,7 +174,7 @@ void ResizeHorizontal(HWND hwnd, bool wide) {
RECT r = { 0, 0, wide ? 422 : 271, 116 };
MapDialogRect(hwnd, &r);
r.bottom += GetSystemMetrics(SM_CYSMCAPTION);
- SetWindowPos(hwnd, 0, 0, 0, r.right, r.bottom, SWP_NOMOVE | SWP_NOZORDER);
+ SetWindowPos(hwnd, nullptr, 0, 0, r.right, r.bottom, SWP_NOMOVE | SWP_NOZORDER);
SetDlgItemText(hwnd, IDC_EXPAND, (wide ? TranslateT("<< Contacts") : TranslateT("Contacts >>")));
ShowWindow(GetDlgItem(hwnd, IDC_CCLIST), wide);
ShowWindow(GetDlgItem(hwnd, IDC_CCLIST_LABEL), wide);
@@ -413,7 +413,7 @@ INT_PTR CALLBACK FBOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
}
else {
proto->delSetting(FACEBOOK_KEY_DEF_GROUP);
- proto->m_tszDefaultGroup = NULL;
+ proto->m_tszDefaultGroup = nullptr;
}
StoreDBCheckState(proto, hwnd, IDC_SET_IGNORE_STATUS, FACEBOOK_KEY_DISABLE_STATUS_NOTIFY);
@@ -477,7 +477,7 @@ INT_PTR CALLBACK FBOptionsStatusesProc(HWND hwnd, UINT message, WPARAM, LPARAM l
{
proto->setByte(FACEBOOK_KEY_SET_MIRANDA_STATUS, setStatus);
if (setStatus && proto->isOnline())
- proto->ForkThread(&FacebookProto::SetAwayMsgWorker, NULL);
+ proto->ForkThread(&FacebookProto::SetAwayMsgWorker, nullptr);
}
return TRUE;
@@ -616,7 +616,7 @@ INT_PTR CALLBACK FBOptionsMessagingProc(HWND hwnd, UINT message, WPARAM wparam,
StoreDBCheckState(proto, hwnd, IDC_HIDE_CHATS, FACEBOOK_KEY_HIDE_CHATS);
StoreDBCheckState(proto, hwnd, IDC_JOIN_EXISTING_CHATS, FACEBOOK_KEY_JOIN_EXISTING_CHATS);
- int count = GetDlgItemInt(hwnd, IDC_MESSAGES_COUNT, NULL, TRUE);
+ int count = GetDlgItemInt(hwnd, IDC_MESSAGES_COUNT, nullptr, TRUE);
count = min(count, FACEBOOK_MESSAGES_ON_OPEN_LIMIT);
proto->setByte(FACEBOOK_KEY_MESSAGES_ON_OPEN_COUNT, count);
}
diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp
index 13129f43f3..c54c59eac6 100644
--- a/protocols/FacebookRM/src/events.cpp
+++ b/protocols/FacebookRM/src/events.cpp
@@ -24,8 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
HWND FacebookProto::NotifyEvent(wchar_t* title, wchar_t* text, MCONTACT contact, EventType type, std::string *url, std::string *notification_id, const char *icon)
{
- if (title == NULL || text == NULL)
- return NULL;
+ if (title == nullptr || text == nullptr)
+ return nullptr;
char name[256];
@@ -80,15 +80,15 @@ HWND FacebookProto::NotifyEvent(wchar_t* title, wchar_t* text, MCONTACT contact,
pd.pwszText = text;
pd.pszClassName = name;
pd.hContact = contact;
- if (icon != NULL) {
+ if (icon != nullptr) {
// pd.hIcon = IcoLib_GetIconByHandle(GetIconHandle(icon)); // FIXME: Uncomment when implemented in Popup+ and YAPP correctly
}
- if (url != NULL || notification_id != NULL) {
+ if (url != nullptr || notification_id != nullptr) {
popup_data *data = new popup_data(this);
- if (url != NULL)
+ if (url != nullptr)
data->url = *url;
- if (notification_id != NULL)
+ if (notification_id != nullptr)
data->notification_id = *notification_id;
pd.PluginData = data;
}
@@ -98,11 +98,11 @@ HWND FacebookProto::NotifyEvent(wchar_t* title, wchar_t* text, MCONTACT contact,
}
else {
if (!Clist_TrayNotifyW(m_szModuleName, title, text, type == EVENT_CLIENT ? NIIF_WARNING : NIIF_INFO, 10000))
- return NULL;
+ return nullptr;
}
if (type == EVENT_CLIENT)
- MessageBox(NULL, text, title, MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, text, title, MB_OK | MB_ICONERROR);
- return NULL;
+ return nullptr;
}
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index 94791a1324..165436cb1b 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -762,13 +762,13 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
// Notify it, if user wants to be notified
if (proto->getByte(FACEBOOK_KEY_EVENT_FRIENDSHIP_ENABLE, DEFAULT_EVENT_FRIENDSHIP_ENABLE)) {
- proto->NotifyEvent(proto->m_tszUserName, ptrW(mir_utf8decodeW(text.c_str())), NULL, EVENT_FRIENDSHIP, &url, alert_id.empty() ? NULL : &alert_id);
+ proto->NotifyEvent(proto->m_tszUserName, ptrW(mir_utf8decodeW(text.c_str())), NULL, EVENT_FRIENDSHIP, &url, alert_id.empty() ? nullptr : &alert_id);
}
}
}
else if (t == "jewel_requests_add") {
// New friendship request, load them all with real names (because there is only user_id in "from" field)
- proto->ForkThread(&FacebookProto::ProcessFriendRequests, NULL);
+ proto->ForkThread(&FacebookProto::ProcessFriendRequests, nullptr);
}
/*else if (t == "jewel_requests_handled") { // revised 5.3.2017
// When some request is approved (or perhaps even ignored/removed)
@@ -870,7 +870,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
if (!buddyList)
continue;
- time_t offlineThreshold = time(NULL) - 15 * 60; // contacts last active more than 15 minutes will be marked offline
+ time_t offlineThreshold = time(nullptr) - 15 * 60; // contacts last active more than 15 minutes will be marked offline
for (auto itNodes = buddyList.begin(); itNodes != buddyList.end(); ++itNodes) {
std::string id = (*itNodes).name();
@@ -944,7 +944,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
if (!overlay_)
continue;
- time_t offlineThreshold = time(NULL) - 15 * 60; // contacts last active more than 15 minutes will be marked offline
+ time_t offlineThreshold = time(nullptr) - 15 * 60; // contacts last active more than 15 minutes will be marked offline
for (auto itNodes = overlay_.begin(); itNodes != overlay_.end(); ++itNodes) {
std::string id = (*itNodes).name();
@@ -1070,7 +1070,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
auto itAlert = notifications->find(id);
if (itAlert != notifications->end()) {
- if (itAlert->second->hWndPopup != NULL)
+ if (itAlert->second->hWndPopup != nullptr)
PUDeletePopup(itAlert->second->hWndPopup); // close popup
delete itAlert->second;
diff --git a/protocols/FacebookRM/src/main.cpp b/protocols/FacebookRM/src/main.cpp
index 7b60f15c60..635bb4a610 100644
--- a/protocols/FacebookRM/src/main.cpp
+++ b/protocols/FacebookRM/src/main.cpp
@@ -117,7 +117,7 @@ extern "C" int __declspec(dllexport) Load(void)
g_strUserAgent = agent.str();
// Initialize random generator (used only as fallback in utils)
- srand(::time(NULL));
+ srand(::time(nullptr));
return 0;
}
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp
index 8054934261..48b86f3981 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -31,7 +31,7 @@ int FacebookProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
void FacebookProto::SendMsgWorker(void *p)
{
- if (p == NULL)
+ if (p == nullptr)
return;
send_direct *data = static_cast<send_direct*>(p);
@@ -69,7 +69,7 @@ void FacebookProto::SendMsgWorker(void *p)
void FacebookProto::SendChatMsgWorker(void *p)
{
- if (p == NULL)
+ if (p == nullptr)
return;
send_chat *data = static_cast<send_chat*>(p);
@@ -101,7 +101,7 @@ void FacebookProto::SendChatMsgWorker(void *p)
UpdateChat(data->chat_id.c_str(), facy.self_.user_id.c_str(), facy.self_.real_name.c_str(), data->msg.c_str());
else {
ptrA text(mir_utf8encode(err_message.c_str()));
- UpdateChat(data->chat_id.c_str(), NULL, NULL, text);
+ UpdateChat(data->chat_id.c_str(), nullptr, nullptr, text);
}
}
}
@@ -128,7 +128,7 @@ int FacebookProto::UserIsTyping(MCONTACT hContact, int type)
void FacebookProto::SendTypingWorker(void *p)
{
- if (p == NULL)
+ if (p == nullptr)
return;
send_typing *typing = static_cast<send_typing*>(p);
@@ -159,7 +159,7 @@ void FacebookProto::SendTypingWorker(void *p)
void FacebookProto::ReadMessageWorker(void *p)
{
- if (p == NULL)
+ if (p == nullptr)
return;
if (getBool(FACEBOOK_KEY_KEEP_UNREAD, 0))
@@ -215,7 +215,7 @@ void FacebookProto::StickerAsSmiley(std::string sticker, const std::string &url,
// Check if we have this sticker already and download it if not
if (GetFileAttributes(filename.c_str()) == INVALID_FILE_ATTRIBUTES) {
- HNETLIBCONN nlc = NULL;
+ HNETLIBCONN nlc = nullptr;
facy.save_url(url, filename, nlc);
Netlib_CloseHandle(nlc);
}
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 297576d219..d2907ca3c9 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -143,7 +143,7 @@ void FacebookProto::ProcessFriendList(void*)
// Wasn't we already been notified about this contact?
if (!getDword(hContact, FACEBOOK_KEY_DELETED, 0)) {
- setDword(hContact, FACEBOOK_KEY_DELETED, ::time(NULL));
+ setDword(hContact, FACEBOOK_KEY_DELETED, ::time(nullptr));
// Notify it, if user wants to be notified
if (getByte(FACEBOOK_KEY_EVENT_FRIENDSHIP_ENABLE, DEFAULT_EVENT_FRIENDSHIP_ENABLE)) {
@@ -208,7 +208,7 @@ void FacebookProto::ProcessUnreadMessages(void*)
void FacebookProto::ProcessUnreadMessage(void *pParam)
{
- if (pParam == NULL)
+ if (pParam == nullptr)
return;
std::vector<std::string> *threads = (std::vector<std::string>*)pParam;
@@ -269,7 +269,7 @@ void FacebookProto::ProcessUnreadMessage(void *pParam)
void FacebookProto::LoadLastMessages(void *pParam)
{
- if (pParam == NULL)
+ if (pParam == nullptr)
return;
MCONTACT hContact = *(MCONTACT*)pParam;
@@ -328,7 +328,7 @@ void FacebookProto::LoadLastMessages(void *pParam)
void FacebookProto::LoadHistory(void *pParam)
{
- if (pParam == NULL)
+ if (pParam == nullptr)
return;
MCONTACT hContact = *(MCONTACT*)pParam;
@@ -384,7 +384,7 @@ void FacebookProto::LoadHistory(void *pParam)
wcsncpy(pd.lptzContactName, m_tszUserName, MAX_CONTACTNAME);
wcsncpy(pd.lptzText, TranslateT("Loading history started."), MAX_SECONDLINE);
- HWND popupHwnd = NULL;
+ HWND popupHwnd = nullptr;
if (ServiceExists(MS_POPUP_ADDPOPUPW)) {
popupHwnd = (HWND)CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, (LPARAM)APF_RETURN_HWND);
}
@@ -835,11 +835,11 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message> &messages, boo
UpdateChat(fbc->thread_id.c_str(), msg.user_id.c_str(), name.c_str(), msg.message_text.c_str(), msg.time);
break;
case ADMIN_TEXT:
- UpdateChat(thread_id.c_str(), NULL, NULL, msg.message_text.c_str());
+ UpdateChat(thread_id.c_str(), nullptr, nullptr, msg.message_text.c_str());
break;
case SUBSCRIBE:
case UNSUBSCRIBE:
- UpdateChat(thread_id.c_str(), NULL, NULL, msg.message_text.c_str());
+ UpdateChat(thread_id.c_str(), nullptr, nullptr, msg.message_text.c_str());
{
std::vector<std::string> ids;
utils::text::explode(msg.data, ";", &ids);
@@ -866,7 +866,7 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message> &messages, boo
}
break;
case THREAD_NAME: {
- UpdateChat(thread_id.c_str(), NULL, NULL, msg.message_text.c_str());
+ UpdateChat(thread_id.c_str(), nullptr, nullptr, msg.message_text.c_str());
std::string chatName = (!msg.data.empty() ? msg.data : GenerateChatName(fbc));
// proto->RenameChat(thread_id.c_str(), chatName.c_str()); // this don't work, why?
@@ -874,7 +874,7 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message> &messages, boo
break;
}
case THREAD_IMAGE:
- UpdateChat(thread_id.c_str(), NULL, NULL, msg.message_text.c_str());
+ UpdateChat(thread_id.c_str(), nullptr, nullptr, msg.message_text.c_str());
break;
}
@@ -958,7 +958,7 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message> &messages, boo
void FacebookProto::ProcessMessages(void* data)
{
- if (data == NULL)
+ if (data == nullptr)
return;
std::string* resp = (std::string*)data;
@@ -994,7 +994,7 @@ void FacebookProto::ShowNotifications() {
// Show popups for unseen notifications and/or write them to chatroom
for (std::map<std::string, facebook_notification*>::iterator it = facy.notifications.begin(); it != facy.notifications.end(); ++it) {
facebook_notification *notification = it->second;
- if (notification != NULL && !notification->seen) {
+ if (notification != nullptr && !notification->seen) {
debugLogA(" Showing popup for notification ID: %s", notification->id.c_str());
ptrW szText(mir_utf8decodeW(notification->text.c_str()));
MCONTACT hContact = (notification->user_id.empty() ? NULL : ContactIDToHContact(notification->user_id));
@@ -1115,11 +1115,11 @@ void FacebookProto::ProcessFriendRequests(void *p)
isNew = true;
setString(hContact, "RequestTime", time.c_str());
- DB_AUTH_BLOB blob(hContact, fbu.real_name.c_str(), 0, 0, fbu.user_id.c_str(), reason.c_str());
+ DB_AUTH_BLOB blob(hContact, fbu.real_name.c_str(), nullptr, nullptr, fbu.user_id.c_str(), reason.c_str());
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = ::time(NULL);
+ dbei.timestamp = ::time(nullptr);
dbei.flags = DBEF_UTF;
dbei.eventType = EVENTTYPE_AUTHREQUEST;
dbei.cbBlob = blob.size();
@@ -1285,7 +1285,7 @@ void FacebookProto::SearchAckThread(void *targ)
// sld is Base64 encoded and then URL encoded string. So replace potential "%3D" with "="
utils::text::replace_all(&sld, "%3D", "=");
// decode Base64 string
- ptrA data_((char*)mir_base64_decode(sld.c_str(), 0));
+ ptrA data_((char*)mir_base64_decode(sld.c_str(), nullptr));
if (data_) {
std::string data = data_;
id = utils::text::source_get_value2(&data, "\"ent_id\":", ",}");
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 281aad172a..68a5364335 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -28,18 +28,18 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) :
{
facy.parent = this;
- signon_lock_ = CreateMutex(NULL, FALSE, NULL);
- avatar_lock_ = CreateMutex(NULL, FALSE, NULL);
- log_lock_ = CreateMutex(NULL, FALSE, NULL);
- update_loop_lock_ = CreateEvent(NULL, FALSE, FALSE, NULL);
- facy.send_message_lock_ = CreateMutex(NULL, FALSE, NULL);
- facy.fcb_conn_lock_ = CreateMutex(NULL, FALSE, NULL);
- facy.notifications_lock_ = CreateMutex(NULL, FALSE, NULL);
- facy.cookies_lock_ = CreateMutex(NULL, FALSE, NULL);
- facy.loading_history_lock_ = CreateMutex(NULL, FALSE, NULL);
+ signon_lock_ = CreateMutex(nullptr, FALSE, nullptr);
+ avatar_lock_ = CreateMutex(nullptr, FALSE, nullptr);
+ log_lock_ = CreateMutex(nullptr, FALSE, nullptr);
+ update_loop_lock_ = CreateEvent(nullptr, FALSE, FALSE, nullptr);
+ facy.send_message_lock_ = CreateMutex(nullptr, FALSE, nullptr);
+ facy.fcb_conn_lock_ = CreateMutex(nullptr, FALSE, nullptr);
+ facy.notifications_lock_ = CreateMutex(nullptr, FALSE, nullptr);
+ facy.cookies_lock_ = CreateMutex(nullptr, FALSE, nullptr);
+ facy.loading_history_lock_ = CreateMutex(nullptr, FALSE, nullptr);
// Initialize random seed for this client
- facy.random_ = ::time(NULL) + PtrToUint(&facy);
+ facy.random_ = ::time(nullptr) + PtrToUint(&facy);
m_enableChat = DEFAULT_ENABLE_CHATS;
@@ -90,10 +90,10 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) :
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.szDescriptiveName.w = descr;
m_hNetlibUser = Netlib_RegisterUser(&nlu);
- if (m_hNetlibUser == NULL) {
+ if (m_hNetlibUser == nullptr) {
wchar_t error[200];
mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
- MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
facy.set_handle(m_hNetlibUser);
@@ -231,14 +231,14 @@ int FacebookProto::SetAwayMsg(int, const wchar_t *msg)
last_status_msg_ = narrow;
if (isOnline() && getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS, DEFAULT_SET_MIRANDA_STATUS))
- ForkThread(&FacebookProto::SetAwayMsgWorker, NULL);
+ ForkThread(&FacebookProto::SetAwayMsgWorker, nullptr);
return 0;
}
void FacebookProto::SetAwayMsgWorker(void *p)
{
- if (p != NULL) {
+ if (p != nullptr) {
status_data *data = static_cast<status_data*>(p);
facy.post_status(data);
delete data;
@@ -254,7 +254,7 @@ void FacebookProto::SetAwayMsgWorker(void *p)
HANDLE FacebookProto::SearchBasic(const wchar_t* id)
{
if (isOffline())
- return 0;
+ return nullptr;
wchar_t *tid = mir_wstrdup(id);
ForkThread(&FacebookProto::SearchIdAckThread, tid);
@@ -264,7 +264,7 @@ HANDLE FacebookProto::SearchBasic(const wchar_t* id)
HANDLE FacebookProto::SearchByEmail(const wchar_t* email)
{
if (isOffline())
- return 0;
+ return nullptr;
wchar_t *temail = mir_wstrdup(email);
ForkThread(&FacebookProto::SearchAckThread, temail);
@@ -297,7 +297,7 @@ MCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
}
if (fbu.user_id.find_first_not_of("0123456789") != std::string::npos) {
- MessageBox(0, TranslateT("Facebook ID must be numeric value."), m_tszUserName, MB_ICONERROR | MB_OK);
+ MessageBox(nullptr, TranslateT("Facebook ID must be numeric value."), m_tszUserName, MB_ICONERROR | MB_OK);
return NULL;
}
@@ -387,7 +387,7 @@ int FacebookProto::OnIdleChanged(WPARAM, LPARAM lParam)
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
// Compute time when user really became idle
- m_idleTS = time(0) - mii.idleTime * 60;
+ m_idleTS = time(nullptr) - mii.idleTime * 60;
setDword("IdleTS", m_idleTS);
} else {
// User stopped being idle
@@ -501,7 +501,7 @@ int FacebookProto::OnOptionsInit(WPARAM wParam, LPARAM)
int FacebookProto::OnToolbarInit(WPARAM, LPARAM)
{
- TTBButton ttb = { 0 };
+ TTBButton ttb = {};
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
char service[100];
@@ -543,7 +543,7 @@ INT_PTR FacebookProto::OnMind(WPARAM wParam, LPARAM)
}
}
- HWND hDlg = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_MIND), (HWND)0, FBMindProc, reinterpret_cast<LPARAM>(data));
+ HWND hDlg = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_MIND), (HWND)nullptr, FBMindProc, reinterpret_cast<LPARAM>(data));
ShowWindow(hDlg, SW_SHOW);
return 0;
@@ -747,7 +747,7 @@ INT_PTR FacebookProto::LoadHistory(WPARAM wParam, LPARAM)
// Allow loading history only from one contact at a time
if (facy.loading_history) {
const wchar_t *message = TranslateT("Loading history is already in progress. It can't run for more contacts at once so please wait until it finishes.");
- MessageBox(0, message, m_tszUserName, MB_ICONWARNING | MB_OK);
+ MessageBox(nullptr, message, m_tszUserName, MB_ICONWARNING | MB_OK);
return 0;
}
@@ -761,7 +761,7 @@ INT_PTR FacebookProto::LoadHistory(WPARAM wParam, LPARAM)
title.AppendFormat(L"%s - %s", m_tszUserName, name);
const wchar_t *message = TranslateT("This will load all messages from the server. To avoid having duplicate messages in your history, delete existing messages manually before continuing.\nLoading process might take a while, so be patient.\n\nDo you want to continue?");
- if (MessageBox(0, message, title, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
+ if (MessageBox(nullptr, message, title, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
ForkThread(&FacebookProto::LoadHistory, new MCONTACT(hContact));
}
@@ -790,7 +790,7 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam, LPARAM lParam)
wchar_t tstr[256];
mir_snwprintf(tstr, TranslateT("Do you want to cancel your friendship with '%s'?"), tname);
- if (MessageBox(0, tstr, m_tszUserName, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
+ if (MessageBox(nullptr, tstr, m_tszUserName, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
ptrA id(getStringA(hContact, FACEBOOK_KEY_ID));
if (id == NULL)
@@ -880,12 +880,12 @@ MCONTACT FacebookProto::HContactFromAuthEvent(MEVENT hEvent)
}
void FacebookProto::OpenUrlThread(void *p) {
- if (p == NULL)
+ if (p == nullptr)
return;
open_url *data = static_cast<open_url*>(p);
- ShellExecute(NULL, L"open", data->browser, data->url, NULL, SW_SHOWDEFAULT);
+ ShellExecute(nullptr, L"open", data->browser, data->url, nullptr, SW_SHOWDEFAULT);
delete data;
}
@@ -936,7 +936,7 @@ void FacebookProto::OpenUrl(std::string url)
void FacebookProto::ReadNotificationWorker(void *p)
{
- if (p == NULL)
+ if (p == nullptr)
return;
std::string *id = (std::string*)p;
@@ -964,7 +964,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
// Get the plugin data (we need the Popup service to do it)
popup_data *data = (popup_data *)PUGetPluginData(hwnd);
- if (data != NULL) {
+ if (data != nullptr) {
if (!data->notification_id.empty())
data->proto->ForkThread(&FacebookProto::ReadNotificationWorker, new std::string(data->notification_id));
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index 2391114df0..f1a093b46b 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -68,7 +68,7 @@ HANDLE GetIconHandle(const char* name)
if (mir_strcmp(icons[i].szName, name) == 0)
return icons[i].hIcolib;
- return 0;
+ return nullptr;
}
// Helper functions
@@ -76,13 +76,13 @@ static FacebookProto * GetInstanceByHContact(MCONTACT hContact)
{
char *proto = GetContactProto(hContact);
if (!proto)
- return 0;
+ return nullptr;
for (int i = 0; i < g_Instances.getCount(); i++)
if (!mir_strcmp(proto, g_Instances[i].m_szModuleName))
return &g_Instances[i];
- return 0;
+ return nullptr;
}
template<INT_PTR(__cdecl FacebookProto::*Fcn)(WPARAM, LPARAM)>