public function viewClan()
 {
     $ninja = new Player(self_char_id());
     $page = in('page', 1, 'non_negative_int');
     $limit = 25;
     $offset = non_negative_int(($page - 1) * $limit);
     $type = 1;
     // Clan chat or normal messages.
     $message_count = Message::countByReceiver($ninja, $type);
     // To count all the messages
     Message::markAsRead($ninja, $type);
     // mark messages as read for next viewing.
     $parts = array_merge($this->configure(), ['messages' => Message::findByReceiver($ninja, $type, $limit, $offset), 'message_count' => $message_count, 'pages' => ceil($message_count / $limit), 'current_page' => $page, 'current_tab' => 'clan', 'has_clan' => (bool) ClanFactory::clanOfMember($ninja)]);
     return $this->render($parts, 'Clan Messages');
 }
 /**
  * View clan messages
  *
  * @param Container
  */
 public function viewClan(Container $p_dependencies)
 {
     $ninja = $p_dependencies['current_player'];
     $page = max(1, (int) RequestWrapper::getPostOrGet('page'));
     $limit = 25;
     $offset = ($page - 1) * $limit;
     $type = 1;
     // Clan chat or normal messages.
     $message_count = Message::countByReceiver($ninja, $type);
     // To count all the messages
     Message::markAsRead($ninja, $type);
     // mark messages as read for next viewing.
     $parts = array_merge($this->configure(), ['messages' => Message::findByReceiver($ninja, $type, $limit, $offset), 'message_count' => $message_count, 'pages' => ceil($message_count / $limit), 'current_page' => $page, 'current_tab' => 'clan', 'has_clan' => (bool) Clan::findByMember($ninja)]);
     return $this->render($parts, 'Clan Messages');
 }