[networking] New function to get a list of watched URL
This commit is contained in:
parent
c27540eb87
commit
d1c28fc4a3
2 changed files with 23 additions and 0 deletions
|
|
@ -36,6 +36,20 @@ def load(datas):
|
|||
#DATAS.delChild(site)
|
||||
|
||||
|
||||
def watchedon(channel):
|
||||
"""Get a list of currently watched URL on the given channel.
|
||||
"""
|
||||
|
||||
res = list()
|
||||
for site in DATAS.getNodes("watch"):
|
||||
if site.hasNode("alert"):
|
||||
for a in site.getNodes("alert"):
|
||||
if a["channel"] == channel:
|
||||
res.append("%s (%s)" % (site["url"], site["type"]))
|
||||
break
|
||||
return res
|
||||
|
||||
|
||||
def del_site(url, nick, channel, frm_owner):
|
||||
"""Remove a site from watching list
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue