Update the comm system to work with the new nicks.
This commit is contained in:
parent
fba6e079c1
commit
316f03308e
2 changed files with 12 additions and 5 deletions
|
|
@ -163,7 +163,7 @@ class CmdDelCom(COMMAND_DEFAULT_CLASS):
|
||||||
chkey = channel.key.lower()
|
chkey = channel.key.lower()
|
||||||
# find all nicks linked to this channel and delete them
|
# find all nicks linked to this channel and delete them
|
||||||
for nick in [nick for nick in make_iter(caller.nicks.get(category="channel", return_obj=True))
|
for nick in [nick for nick in make_iter(caller.nicks.get(category="channel", return_obj=True))
|
||||||
if nick and nick.strvalue.lower() == chkey]:
|
if nick and nick.value[3].lower() == chkey]:
|
||||||
nick.delete()
|
nick.delete()
|
||||||
disconnect = channel.disconnect(player)
|
disconnect = channel.disconnect(player)
|
||||||
if disconnect:
|
if disconnect:
|
||||||
|
|
@ -297,7 +297,7 @@ class CmdChannels(COMMAND_DEFAULT_CLASS):
|
||||||
comtable.add_row(*["%s%s" % (chan.key, chan.aliases.all() and
|
comtable.add_row(*["%s%s" % (chan.key, chan.aliases.all() and
|
||||||
"(%s)" % ",".join(chan.aliases.all()) or ""),
|
"(%s)" % ",".join(chan.aliases.all()) or ""),
|
||||||
"%s" % ",".join(nick.db_key for nick in make_iter(nicks)
|
"%s" % ",".join(nick.db_key for nick in make_iter(nicks)
|
||||||
if nick and nick.strvalue.lower() == clower),
|
if nick and nick.value[3].lower() == clower),
|
||||||
chan.db.desc])
|
chan.db.desc])
|
||||||
caller.msg("\n{wChannel subscriptions{n (use {w@channels{n to list all, {waddcom{n/{wdelcom{n to sub/unsub):{n\n%s" % comtable)
|
caller.msg("\n{wChannel subscriptions{n (use {w@channels{n to list all, {waddcom{n/{wdelcom{n to sub/unsub):{n\n%s" % comtable)
|
||||||
else:
|
else:
|
||||||
|
|
@ -312,7 +312,7 @@ class CmdChannels(COMMAND_DEFAULT_CLASS):
|
||||||
"%s%s" % (chan.key, chan.aliases.all() and
|
"%s%s" % (chan.key, chan.aliases.all() and
|
||||||
"(%s)" % ",".join(chan.aliases.all()) or ""),
|
"(%s)" % ",".join(chan.aliases.all()) or ""),
|
||||||
"%s" % ",".join(nick.db_key for nick in make_iter(nicks)
|
"%s" % ",".join(nick.db_key for nick in make_iter(nicks)
|
||||||
if nick.strvalue.lower() == clower),
|
if nick.value[3].lower() == clower),
|
||||||
str(chan.locks),
|
str(chan.locks),
|
||||||
chan.db.desc])
|
chan.db.desc])
|
||||||
caller.msg("\n{wAvailable channels{n (use {wcomlist{n,{waddcom{n and {wdelcom{n to manage subscriptions):\n%s" % comtable)
|
caller.msg("\n{wAvailable channels{n (use {wcomlist{n,{waddcom{n and {wdelcom{n to manage subscriptions):\n%s" % comtable)
|
||||||
|
|
|
||||||
|
|
@ -660,7 +660,7 @@ class NickHandler(AttributeHandler):
|
||||||
"""
|
"""
|
||||||
return super(NickHandler, self).has(key, category=category)
|
return super(NickHandler, self).has(key, category=category)
|
||||||
|
|
||||||
def get(self, key=None, category="inputline", **kwargs):
|
def get(self, key=None, category="inputline", return_tuple=False, **kwargs):
|
||||||
"""
|
"""
|
||||||
Get the replacement value matching the given key and category
|
Get the replacement value matching the given key and category
|
||||||
|
|
||||||
|
|
@ -671,10 +671,17 @@ class NickHandler(AttributeHandler):
|
||||||
category (str, optional): the category within which to
|
category (str, optional): the category within which to
|
||||||
retrieve the nick. The "inputline" means replacing data
|
retrieve the nick. The "inputline" means replacing data
|
||||||
sent by the user.
|
sent by the user.
|
||||||
|
return_tuple (bool, optional): return the full nick tuple rather
|
||||||
|
than just the replacement. For non-template nicks this is just
|
||||||
|
a string.
|
||||||
kwargs (any, optional): These are passed on to `AttributeHandler.get`.
|
kwargs (any, optional): These are passed on to `AttributeHandler.get`.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if return_tuple or "return_obj" in kwargs:
|
||||||
return super(NickHandler, self).get(key=key, category=category, **kwargs)
|
return super(NickHandler, self).get(key=key, category=category, **kwargs)
|
||||||
|
else:
|
||||||
|
retval = super(NickHandler, self).get(key=key, category=category, **kwargs)
|
||||||
|
return retval[3] if isinstance(retval, tuple) else [tup[3] for tup in make_iter(retval)]
|
||||||
|
|
||||||
def add(self, key, replacement, category="inputline", **kwargs):
|
def add(self, key, replacement, category="inputline", **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue