private function processAllMessages()
    { 
        $processed = [];

        $receivers = $this->receivers();

        $messages = $this->manager->getMessages();
        
        foreach ($receivers as $receiver)
        {   
            foreach ($messages as $index => $message)
            {                
                $this->composition($receiver, $message);

                $id = $this->sendMessage($receiver, $message);

                $copy = new stdClass();
                $copy->id = $id;
                $copy->type = $message->type;
                $copy->sender = $this->account['number'];
                $copy->nickname = $this->account['nickname'];
                $copy->to = implode(', ', (array) $receiver);

                $copy->message = $message;

                if(isset($message->file) && !$message->hash)
                {
                    $copy->message->hash = $messages[$index]->hash = base64_encode(hash_file("sha256", $message->file, true));
                }

                foreach ($this->manager->getInjectedVars() as $key => $value)
                {
                    $copy->$key = $value;
                }

                $processed[] = $copy;
            }
        }

        $this->broadcast = false;

        $this->manager->clear();

        return $processed;
    }
private function processAllMessages()
    { 
        $processed = [];

        $receivers = $this->receivers();

        $messages = $this->manager->getMessages();
        
        foreach ($receivers as $receiver)
        {   
            foreach ($messages as $index => $message)
            {                
                $this->composition($receiver, $message);

                $id = $this->sendMessage($receiver, $message);

                $copy = new stdClass();
                $copy->id = $id;
                $copy->type = $message->type;
                $copy->sender = $this->account['number'];
                $copy->nickname = $this->account['nickname'];
                $copy->to = implode(', ', (array) $receiver);

                $copy->message = $message;

                if(isset($message->file) && !$message->hash)
                {
                    $copy->message->hash = $messages[$index]->hash = base64_encode(hash_file("sha256", $message->file, true));
                }

                foreach ($this->manager->getInjectedVars() as $key => $value)
                {
                    $copy->$key = $value;
                }

                $processed[] = $copy;
            }
        }

        $this->broadcast = false;

        $this->manager->clear();

        return $processed;
    }
private function processAllMessages ( ) { $ processed = [ ] ; $ receivers = $ this -> receivers ( ) ; $ messages = $ this -> manager -> getMessages ( ) ; foreach ( $ receivers as $ receiver ) { foreach ( $ messages as $ index => $ message ) { $ this -> composition ( $ receiver , $ message ) ; $ id = $ this -> sendMessage ( $ receiver , $ message ) ; $ copy = new stdClass ( ) ; $ copy -> id = $ id ; $ copy -> type = $ message -> type ; $ copy -> sender = $ this -> account [ 'number' ] ; $ copy -> nickname = $ this -> account [ 'nickname' ] ; $ copy -> to = implode ( ', ' , ( array ) $ receiver ) ; $ copy -> message = $ message ; if ( isset ( $ message -> file ) && ! $ message -> hash ) { $ copy -> message -> hash = $ messages [ $ index ] -> hash = base64_encode ( hash_file ( "sha256" , $ message -> file , true ) ) ; } foreach ( $ this -> manager -> getInjectedVars ( ) as $ key => $ value ) { $ copy -> $ key = $ value ; } $ processed [ ] = $ copy ; } } $ this -> broadcast = false ; $ this -> manager -> clear ( ) ; return $ processed ; }
Process all messages types

@return array
Process all messages types