[mw-devel] [Git][arthur/mw][master] Don't use json_boolean()

Andrew Price welshbyte at sucs.org
Tue Nov 6 19:06:18 GMT 2018


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
8511c565 by Andrew Price at 2018-11-06T19:05:54+00:00
Don't use json_boolean()

- - - - -


1 changed file:

- src/client/onoff.c


Changes:

=====================================
src/client/onoff.c
=====================================
--- a/src/client/onoff.c
+++ b/src/client/onoff.c
@@ -19,7 +19,7 @@ int announce_logon(const char *usr, int type, int quiet)
 	json_addstring(j, "user", usr);
 	json_addint(j, "action", ONOFF_LOGON);
 	json_addint(j, "type", type);
-	json_object_set(j, "quiet", json_boolean(quiet));
+	json_object_set(j, "quiet", quiet ? json_true() : json_false());
 
 	msg = ipcmsg_create(IPC_CHECKONOFF, user->posn);
 	ipcmsg_destination(msg, SYSTEM_USER);
@@ -38,7 +38,7 @@ int announce_logoff(const char *usr, int type, const char *agent, const char *re
 	json_addstring(j, "user", usr);
 	json_addint(j, "action", ONOFF_LOGOFF);
 	json_addint(j, "type", type);
-	json_object_set(j, "quiet", json_boolean(quiet));
+	json_object_set(j, "quiet", quiet ? json_true() : json_false());
 	if (agent != NULL)
 		json_addstring(j, "agent", agent);
 	if (reason != NULL)
@@ -62,7 +62,7 @@ int announce_join(const char *usr, int channel, int type, const char *agent, int
 	json_addint(j, "action", ONOFF_JOIN);
 	json_addint(j, "channel", channel);
 	json_addint(j, "type", type);
-	json_object_set(j, "quiet", json_boolean(quiet));
+	json_object_set(j, "quiet", quiet ? json_true() : json_false());
 	if (agent != NULL)
 		json_addstring(j, "agent", agent);
 
@@ -84,7 +84,7 @@ int announce_leave(const char *usr, int channel, int type, const char *agent, co
 	json_addint(j, "action", ONOFF_LEAVE);
 	json_addint(j, "channel", channel);
 	json_addint(j, "type", type);
-	json_object_set(j, "quiet", json_boolean(quiet));
+	json_object_set(j, "quiet", quiet ? json_true() : json_false());
 	if (agent != NULL)
 		json_addstring(j, "agent", agent);
 	if (lmsg != NULL)



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/8511c565f51f130c27969b513bdfd5401d217555

-- 
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/8511c565f51f130c27969b513bdfd5401d217555
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20181106/ab8cd998/attachment-0001.html>


More information about the mw-devel mailing list