Fixed missing variable in formatting of disconnect string in delcom, made display of @channels more legible and display when someone is Muted rather than not subscribed. Refactored the 'who' list for channels to now be a property of the channel that returns a string of all the subscribers separated by commas, with those who are actively listening (not muted) in bold, and made both '@cwho' and 'allcom who' call to it.
This commit is contained in:
parent
951cd60a6d
commit
c32920999b
2 changed files with 23 additions and 14 deletions
|
|
@ -83,6 +83,17 @@ class DefaultChannel(with_metaclass(TypeclassBase, ChannelDB)):
|
|||
def mutelist(self):
|
||||
return self.db.mute_list or []
|
||||
|
||||
@property
|
||||
def wholist(self):
|
||||
subs = self.db_subscriptions.all()
|
||||
listening = [ob for ob in subs if ob.is_connected and ob not in self.mutelist]
|
||||
if subs:
|
||||
# display listening subscribers in bold
|
||||
string = ", ".join([player.key if player not in listening else "{w%s{n" % player.key for player in subs])
|
||||
else:
|
||||
string = "<None>"
|
||||
return string
|
||||
|
||||
def mute(self, subscriber):
|
||||
"""
|
||||
Adds an entity to the list of muted subscribers.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue