From de195c2fca2f4b77a54be68fb58cd0ccee10a5b7 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Tue, 15 Jan 2019 03:59:32 +0100 Subject: timeline is ok for messaging --- app/class/event.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'app/class/event.php') diff --git a/app/class/event.php b/app/class/event.php index a23fff9..9fc75d2 100644 --- a/app/class/event.php +++ b/app/class/event.php @@ -8,6 +8,7 @@ class Event extends Dbitem protected $user; protected $target; protected $message; + protected $clap = 0; const EVENT_TYPES = ['message', 'art_add', 'art_edit', 'art_delete', 'media_add', 'media_delete', 'font_add']; const EVENT_BASE = ['message']; @@ -29,9 +30,16 @@ class Event extends Dbitem $this->user = idclean($this->user); if (in_array($this->type, self::EVENT_ART)) { $this->target = idclean($this->target); + } elseif ($this->type === 'message') { + $this->message = htmlspecialchars($this->message); } } + public function addclap() + { + $this->clap ++; + } + // _____________________ G E T __________________________ public function id() @@ -78,6 +86,11 @@ class Event extends Dbitem return $this->message; } + public function clap() + { + return $this->clap; + } + // ________________________ S E T ____________________ @@ -126,6 +139,13 @@ class Event extends Dbitem } } + public function setclap($clap) + { + if(is_int($clap)) { + $this->clap = $clap; + } + } + -- cgit v1.2.3