summaryrefslogtreecommitdiff
path: root/protocols/Discord
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/Discord
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'protocols/Discord')
-rw-r--r--protocols/Discord/src/dispatch.cpp6
-rw-r--r--protocols/Discord/src/guilds.cpp4
-rw-r--r--protocols/Discord/src/menus.cpp4
-rw-r--r--protocols/Discord/src/utils.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index 5e615367b3..cd5dbf7ec3 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -144,7 +144,7 @@ void CDiscordProto::OnCommandChannelUpdated(const JSONNode &pRoot)
GCEVENT gce = { m_szModuleName, pUser->wszUsername, GC_EVENT_TOPIC };
gce.ptszText = wszTopic;
- gce.time = time(0);
+ gce.time = time(nullptr);
Chat_Event(&gce);
}
}
@@ -228,7 +228,7 @@ void CDiscordProto::OnCommandGuildMemberRemoved(const JSONNode &pRoot)
continue;
GCEVENT gce = { m_szModuleName, pUser.wszUsername, GC_EVENT_PART };
- gce.time = time(0);
+ gce.time = time(nullptr);
gce.ptszUID = wszUserId;
Chat_Event(&gce);
}
@@ -263,7 +263,7 @@ void CDiscordProto::OnCommandGuildMemberUpdated(const JSONNode &pRoot)
}
GCEVENT gce = { m_szModuleName, pUser.wszUsername, GC_EVENT_NICK };
- gce.time = time(0);
+ gce.time = time(nullptr);
gce.ptszUID = wszUserId;
gce.ptszNick = wszOldNick;
gce.ptszText = gm->wszNick;
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index 52c1f290ed..db21b69cc2 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -114,7 +114,7 @@ CDiscordUser* CDiscordProto::ProcessGuildChannel(CDiscordGuild *pGuild, const JS
Chat_SetStatusbarText(m_szModuleName, wszChannelId, wszTopic);
GCEVENT gce = { m_szModuleName, wszChannelId, GC_EVENT_TOPIC };
- gce.time = time(0);
+ gce.time = time(nullptr);
gce.ptszText = wszTopic;
Chat_Event(&gce);
}
@@ -151,7 +151,7 @@ CDiscordUser* CDiscordProto::ProcessGuildChannel(CDiscordGuild *pGuild, const JS
void CDiscordProto::AddUserToChannel(const CDiscordUser &pChannel, const CDiscordGuildMember &pUser)
{
GCEVENT gce = { m_szModuleName, pChannel.wszUsername, GC_EVENT_JOIN };
- gce.time = time(0);
+ gce.time = time(nullptr);
gce.dwFlags = GCEF_SILENT;
wchar_t wszUserId[100];
diff --git a/protocols/Discord/src/menus.cpp b/protocols/Discord/src/menus.cpp
index c5f0fff585..4c3cf1ab5c 100644
--- a/protocols/Discord/src/menus.cpp
+++ b/protocols/Discord/src/menus.cpp
@@ -39,7 +39,7 @@ INT_PTR CDiscordProto::OnMenuCopyId(WPARAM hContact, LPARAM)
INT_PTR CDiscordProto::OnMenuCreateChannel(WPARAM hContact, LPARAM)
{
- ENTER_STRING es = { sizeof(es), ESF_COMBO, m_szModuleName, "channel_name", TranslateT("Enter channel name"), 0, 5 };
+ ENTER_STRING es = { sizeof(es), ESF_COMBO, m_szModuleName, "channel_name", TranslateT("Enter channel name"), nullptr, 5 };
if (EnterString(&es)) {
JSONNode roles(JSON_ARRAY); roles.set_name("permission_overwrites");
JSONNode root; root << INT_PARAM("type", 0) << WCHAR_PARAM("name", es.ptszResult) << roles;
@@ -54,7 +54,7 @@ INT_PTR CDiscordProto::OnMenuCreateChannel(WPARAM hContact, LPARAM)
INT_PTR CDiscordProto::OnMenuJoinGuild(WPARAM, LPARAM)
{
- ENTER_STRING es = { sizeof(es), ESF_COMBO, m_szModuleName, "guild_name", TranslateT("Enter invitation code you received"), 0, 5 };
+ ENTER_STRING es = { sizeof(es), ESF_COMBO, m_szModuleName, "guild_name", TranslateT("Enter invitation code you received"), nullptr, 5 };
if (EnterString(&es)) {
CMStringA szUrl(FORMAT, "/invite/%S", es.ptszResult);
Push(new AsyncHttpRequest(this, REQUEST_POST, szUrl, nullptr));
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp
index b60e03df6b..a3ebd86284 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -81,7 +81,7 @@ time_t StringToDate(const CMStringW &str)
struct tm T = { 0 };
int boo;
if (swscanf(str, L"%04d-%02d-%02dT%02d:%02d:%02d.%d", &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, &boo) != 7)
- return time(0);
+ return time(nullptr);
T.tm_year -= 1900;
T.tm_mon--;