@@ -444,15 +444,15 @@ def on_message(self):
444
444
def on_message (self , method ) -> None :
445
445
self ._on_message = method
446
446
447
- def _handle_on_message (self , client , topic : str , message : str ):
447
+ def _handle_on_message (self , topic : str , message : str ):
448
448
matched = False
449
449
if topic is not None :
450
450
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
452
452
matched = True
453
453
454
454
if not matched and self .on_message : # regular on_message
455
- self .on_message (client , topic , message )
455
+ self .on_message (self , topic , message )
456
456
457
457
def username_pw_set (self , username : str , password : Optional [str ] = None ) -> None :
458
458
"""Set client's username and an optional password.
@@ -1072,7 +1072,7 @@ def _wait_for_msg(self) -> Optional[int]:
1072
1072
raw_msg = self ._sock_exact_recv (sz )
1073
1073
msg = raw_msg if self ._use_binary_mode else str (raw_msg , "utf-8" )
1074
1074
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 )
1076
1076
if res [0 ] & 0x06 == 0x02 :
1077
1077
pkt = bytearray (b"\x40 \x02 \0 \0 " )
1078
1078
struct .pack_into ("!H" , pkt , 2 , pid )
0 commit comments