mirror of
https://github.com/evennia/evennia.git
synced 2026-03-29 03:57:17 +02:00
Fixed bug that allowed addcom to set the same alias to two different channels.
/Griatch
This commit is contained in:
parent
35676b7660
commit
6d45c98b8e
1 changed files with 13 additions and 2 deletions
|
|
@ -39,11 +39,22 @@ def cmd_addcom(command):
|
|||
else:
|
||||
chan_name = command_argument.strip()
|
||||
chan_alias = chan_name
|
||||
|
||||
|
||||
membership = source_object.channel_membership_set.filter(channel__name__iexact=chan_name)
|
||||
try:
|
||||
chan = CommChannel.objects.get(name__iexact=chan_name)
|
||||
s = ""
|
||||
s = ""
|
||||
|
||||
#if we happened to have this alias already defined on another channel, make
|
||||
#sure to tell us.
|
||||
aliasmatch = [cmatch.channel.name for cmatch in
|
||||
source_object.channel_membership_set.filter(user_alias=chan_alias)
|
||||
if cmatch.channel.name != chan_name]
|
||||
if aliasmatch:
|
||||
s = "The alias '%s' is already in use (for channel '%s')." % (chan_alias, aliasmatch[0])
|
||||
source_object.emit_to(s)
|
||||
return
|
||||
|
||||
if membership:
|
||||
#we are already members of this channel. Set a different alias.
|
||||
# Note: To this without requiring a the user to logout then login again,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue