1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Strip ipAddress from JSON output

This commit is contained in:
Tim Düsterhus 2016-08-17 20:36:19 +02:00
parent a9c2e4fe30
commit 2e706d22b9

View File

@ -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;