Skip to content

Commit

Permalink
Merge pull request #196 from aapa/autoop-glob
Browse files Browse the repository at this point in the history
Add wildcard support to autoop module
  • Loading branch information
lepinkainen committed Feb 23, 2016
2 parents 5ce0496 + 9bfd341 commit 8a676c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyfibot/modules/module_autoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ def add_op(channel, hostmask, modes='o'):
def remove_op(channel, hostmask):
if get_op_status(channel, hostmask):
conn, c = open_DB()
c.execute('DELETE FROM autoops WHERE channel = ? AND hostmask = ?;', (channel, hostmask))
c.execute('DELETE FROM autoops WHERE channel = ? AND ? GLOB hostmask;', (channel, hostmask))
conn.commit()
conn.close()
return True


def get_op_status(channel, hostmask):
conn, c = open_DB()
c.execute('SELECT * FROM autoops WHERE channel = ? AND hostmask = ? LIMIT 1;', (channel, hostmask))
c.execute('SELECT * FROM autoops WHERE channel = ? AND ? GLOB hostmask LIMIT 1;', (channel, hostmask))
if c.fetchone():
retval = True
else:
Expand All @@ -61,7 +61,7 @@ def get_op_status(channel, hostmask):

def get_user_channels(hostmask):
conn, c = open_DB()
c.execute('SELECT channel FROM autoops WHERE hostmask = ?;', (hostmask,))
c.execute('SELECT channel FROM autoops WHERE ? GLOB hostmask;', (hostmask,))
rows = c.fetchall()
conn.close()
return rows
Expand Down

0 comments on commit 8a676c3

Please sign in to comment.