File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -1273,15 +1273,21 @@ public static function insertMessageRequest(Message $message): bool
12731273 }
12741274
12751275 // Insert the forwarded message user in users table
1276- $ forward_date = $ message ->getForwardDate () ? self ::getTimestamp ($ message ->getForwardDate ()) : null ;
1276+ $ forward_date = $ message ->getForwardDate () ? self ::getTimestamp ($ message ->getForwardOrigin ()-> getDate ()) : null ;
12771277
1278- if ($ forward_from = $ message ->getForwardFrom ()) {
1279- self ::insertUser ($ forward_from );
1280- $ forward_from = $ forward_from ->getId ();
1278+ $ forward_origin = $ message ->getForwardOrigin ();
1279+ if ($ forward_origin instanceof MessageOriginUser){
1280+ self ::insertUser ($ forward_origin ->getUser ());
1281+ $ forward_from = $ forward_origin ->getUser ()->getId ();
12811282 }
1282- if ($ forward_from_chat = $ message ->getForwardFromChat ()) {
1283- self ::insertChat ($ forward_from_chat );
1284- $ forward_from_chat = $ forward_from_chat ->getId ();
1283+ if ($ forward_origin instanceof MessageOriginChat){
1284+ self ::insertChat ($ forward_origin ->getChat ());
1285+ $ forward_from_chat = $ forward_origin ->getChat ()->getId ();
1286+ }
1287+ if ($ forward_origin instanceof MessageOriginChannel){
1288+ self ::insertChat ($ forward_origin ->getChat ());
1289+ $ forward_from_chat = $ forward_origin ->getChat ()->getId ();
1290+
12851291 }
12861292
12871293 $ via_bot_id = null ;
You can’t perform that action at this time.
0 commit comments