File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,6 +206,15 @@ def pong(self):
206206 """ Send a pong message to the server. """
207207 self ._send_message (messages .pong (self ._state .server ))
208208
209+ def is_op_in (self , channel ):
210+ """
211+ Check if this client has operator rights in the given channel.
212+
213+ Args:
214+ channel (str): the channel (case-insensitive)
215+ """
216+ return channel .lower () in self ._state .operatorIn ;
217+
209218 # --- Private methods ---
210219
211220 def _send_message (self , message ):
@@ -380,8 +389,7 @@ def __init__(self):
380389 # Note: Nicks in server messages always have the case in which they
381390 # were registered.
382391 self .nick = None
383- # Note: Channel names seem to be always lower case in messages from
384- # the server.
392+ # Note: Channel names will always be saved lower case
385393 self .channels = []
386394 # Channels, where the client is channel operator in:
387395 self .operatorIn = []
Original file line number Diff line number Diff line change @@ -102,7 +102,8 @@ def parse_message_target(msg_target):
102102 if msgto .startswith ('#' ) or \
103103 msgto .startswith ('+' ) or \
104104 msgto .startswith ('&' ):
105- mt = MessageTarget (channel = msgto )
105+ # We want channel names to always be lower-case in fredirc!
106+ mt = MessageTarget (channel = msgto .lower ())
106107 elif '@' in msgto :
107108 user_split = msgto .split ('@' , 1 )
108109 if '!' in user_split [0 ]:
Original file line number Diff line number Diff line change 2020 dependencies = []
2121
2222def read (file ):
23- """ Utility function to the the README file. """
23+ """ Utility function to read the README- file. """
2424 return open (os .path .join (os .path .dirname (__file__ ), file )).read ()
2525
2626setup (
You can’t perform that action at this time.
0 commit comments