Check if current message is sent by user

@return boolean
967571
private function isUserMessage()
    {
        if (!empty($this->message) && isset($this->message['metadata'])) {
            return $this->message['metadata'] != 'SENT_BY_GIGA_AI';
        }

        return true;
    }
532299
public function hasMessage()
    {
        $has_message = parent::hasMessage();

        if (!$has_message) {
            foreach ($this->children as &$child) {
                if ($child->hasMessage()) {
                    $has_message = true;
                    break;
                }
            }
        }

        return $has_message;
    }
182864
protected function validateEmailExistsUser()
    {
        $field = 'email';
        $value = $this->getSubmitted($field);

        if ($this->isError($field) || !isset($value)) {
            return null;
        }

        $user = $this->user->getByEmail($value);

        if (empty($user['status'])) {
            $this->setErrorUnavailable($field, $this->translation->text('E-mail'));
            return false;
        }

        $this->setSubmitted($field, $user);
        return true;
    }
1348159
public function isLocked()
    {
        $result = false;
        if(!$this->isNew())
        {
            if(isset($this->locked_on) && isset($this->locked_by))
            {
                $locked  = strtotime($this->locked_on);
                $current = strtotime(gmdate('Y-m-d H:i:s'));

                //Check if the lock has gone stale
                if($current - $locked < $this->_lifetime)
                {
                    $userid = $this->getObject('user')->getId();
                    if($this->locked_by != 0 && $this->locked_by != $userid) {
                        $result= true;
                    }
                }
            }
        }

        return $result;
    }
1287633
public function check()
    {
        $current = $this->getCurrentUptime();

        $inTrouble =
            $current['load_1'] > $this->target->maxLoad['load_1'] ||
            $current['load_5'] > $this->target->maxLoad['load_5'] ||
            $current['load_15'] > $this->target->maxLoad['load_15'];

        return $this->makeResult(! $inTrouble, $this->makeMessage($current));
    }
1309910
public function isCurrent()
    {
        $link = $this->getLink();
        if ($link{0} == '/') {
            $link = substr($link, 1);
        }

        return request()->is($link);
    }
1047059
public function current()
    {
        if(!isset($this->messages[$this->position])){
            $this->messages[$this->position] = new Message($this->data['messages'][$this->position]);
        }

        return $this->messages[$this->position];
    }
215750
function getLastMessage() {
        if(!empty($this->lastMessageID) && $this->messages->has($this->lastMessageID)) {
            return $this->messages->get($this->lastMessageID);
        }
        
        return null;
    }
921671
public function sendRecoveryMessage() {
    if ($this->validate()) {
      /** @var Token $token */
      $token = Yii::createObject([
        'class' => Token::className(),
        'userId' => $this->user->id,
        'type' => Token::TYPE_RECOVERY,
      ]);

      if (!$token->save(false)) {
        return false;
      }

      if (!$this->mailer->sendRecoveryMessage($this->user, $token)) {
        return false;
      }

      Yii::$app->session->setFlash('info',
        Yii::t('users', 'An email has been sent with instructions for resetting your password')
      );

      return true;
    }

    return false;
  }
45823
public function is_authenticated() {
		$retval = false;
		$parentRes = false;
		
		try {
			if(parent::is_authenticated()) {
				$parentRes = true;
				$retval = $this->is_valid_sid($this->sid);
			}
		}
		catch(Exception $e) {
			$this->exception_handler($e->getMessage());
		}
		
		return ($retval);
	}
459272
public function markAsUnread()
	{
		if (!$this->get('id'))
		{
			$this->addError('Recipient record not found');
			return false;
		}

		$xseen = Seen::oneByMessageAndUser($this->get('mid'), $this->get('uid'));

		if ($xseen->get('id'))
		{
			if (!$xseen->destroy())
			{
				$this->addError($xseen->getError());
				return false;
			}
		}

		return true;
	}
584897
public function emailCheck($warnings)
    {
        if ($warnings) {
            foreach ($warnings as $warning) {
                if ($warning === static::warnings()['email']) {
                    return false;
                }
            }
        }
        $user = User::findMe();
        if ($user && empty($user->email)) {
            $this->warning(static::warnings()['email'], false);
        }
        return false;
    }
843699
public function Connected() {
    if(!empty($this->smtp_conn)) {
      $sock_status = socket_get_status($this->smtp_conn);
      if($sock_status["eof"]) {
        // the socket is valid but we are not connected
        if($this->do_debug >= 1) {
            $this->edebug("SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected");
        }
        $this->Close();
        return false;
      }
      return true; // everything looks good
    }
    return false;
  }
251770
public function isLogged() {
        if ($this->isAuthenticated === false) {
            $this->isAuthenticated = $this->checkSession($this->getCurrentSessionHash());
        }
        return $this->isAuthenticated;
    }
435096
public function sendHeader()
    {
        $file = $line = null;
        if ($this->isHeaderSent($file, $line)) {
            if ($this->wei->has('logger')) {
                $this->logger->debug(sprintf('Header has been at %s:%s', $file, $line));
            }
            return false;
        }

        // Send status
        $this->sendRawHeader(sprintf('HTTP/%s %d %s', $this->version, $this->statusCode, $this->statusText));

        // Send headers
        foreach ($this->headers as $name => $values) {
            foreach ($values as $value) {
                $this->sendRawHeader($name . ': ' . $value);
            }
        }

        $this->sendCookie();

        return true;
    }
318511
public function hasMessages()
    {
        return !empty($this->notices) || !empty($this->warnings) || !empty($this->errors) || !empty($this->exception);
    }
663939
private function checkCookieAuth()
    {
        if (strlen(trim($this->getUsername())) == 0) {
            $this->objConnector->cleanupSession();
            $this->objConnector->refreshSession();
            return false;
        }
        return true;
    }