From 2e706d22b98ccaebb8acd670583abdc15f4c0f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 17 Aug 2016 20:36:19 +0200 Subject: [PATCH] Strip ipAddress from JSON output --- file/lib/data/message/Message.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/file/lib/data/message/Message.class.php b/file/lib/data/message/Message.class.php index cd841b9..64c58d4 100644 --- a/file/lib/data/message/Message.class.php +++ b/file/lib/data/message/Message.class.php @@ -137,12 +137,16 @@ public function getUsername($colored = false) { * @return string */ public function jsonify($raw = false) { + $additionalData = $this->additionalData; switch ($this->type) { case self::TYPE_WHISPER: case self::TYPE_NORMAL: case self::TYPE_INFORMATION: $separator = ':'; break; + case self::TYPE_JOIN: + unset($additionalData['ipAddress']); + break; default: $separator = ''; break; @@ -161,7 +165,7 @@ public function jsonify($raw = false) { 'type' => (int) $this->type, 'roomID' => (int) $this->roomID, 'messageID' => (int) $this->messageID, - 'additionalData' => $this->additionalData + 'additionalData' => $additionalData ); if ($raw) return $array;