@@ -444,15 +444,15 @@ def on_message(self):
444444 def on_message (self , method ) -> None :
445445 self ._on_message = method
446446
447- def _handle_on_message (self , client , topic : str , message : str ):
447+ def _handle_on_message (self , topic : str , message : str ):
448448 matched = False
449449 if topic is not None :
450450 for callback in self ._on_message_filtered .iter_match (topic ):
451- callback (client , topic , message ) # on_msg with callback
451+ callback (self , topic , message ) # on_msg with callback
452452 matched = True
453453
454454 if not matched and self .on_message : # regular on_message
455- self .on_message (client , topic , message )
455+ self .on_message (self , topic , message )
456456
457457 def username_pw_set (self , username : str , password : Optional [str ] = None ) -> None :
458458 """Set client's username and an optional password.
@@ -1072,7 +1072,7 @@ def _wait_for_msg(self) -> Optional[int]:
10721072 raw_msg = self ._sock_exact_recv (sz )
10731073 msg = raw_msg if self ._use_binary_mode else str (raw_msg , "utf-8" )
10741074 self .logger .debug ("Receiving PUBLISH \n Topic: %s\n Msg: %s\n " , topic , raw_msg )
1075- self ._handle_on_message (self , topic , msg )
1075+ self ._handle_on_message (topic , msg )
10761076 if res [0 ] & 0x06 == 0x02 :
10771077 pkt = bytearray (b"\x40 \x02 \0 \0 " )
10781078 struct .pack_into ("!H" , pkt , 2 , pid )
0 commit comments