Added option to disable corp groups in TS3

This commit is contained in:
2011-09-21 12:53:50 +01:00
parent 5fef8a44f7
commit 6fc1f4b7b6

View File

@@ -16,7 +16,8 @@ class TS3Service(BaseService):
'authed_sgid': 12, 'authed_sgid': 12,
'name_format': '%(alliance)s - %(corporation)s - %(name)s', 'name_format': '%(alliance)s - %(corporation)s - %(name)s',
'bookmark_name': 'TEST Alliance TS3', 'bookmark_name': 'TEST Alliance TS3',
'ignore_groups': [6]} 'ignore_groups': [6],
'corporation_groups': True }
def __init__(self): def __init__(self):
pass pass
@@ -171,14 +172,15 @@ class TS3Service(BaseService):
self.conn.send_command('servergroupaddclient', {'sgid': tsgrplist[g.name], 'cldbid': cldbid }) self.conn.send_command('servergroupaddclient', {'sgid': tsgrplist[g.name], 'cldbid': cldbid })
usrgrplist[g.name] = tsgrplist[g.name] usrgrplist[g.name] = tsgrplist[g.name]
# Add to corporation groups # Add to corporation groups if enabled
if character and character.corporation: if self.settings['corporation_groups']:
if character.corporation.ticker in usrgrplist: if character and character.corporation:
del usrgrplist[character.corporation.ticker] if character.corporation.ticker in usrgrplist:
else: del usrgrplist[character.corporation.ticker]
if not character.corporation.ticker in tsgrplist: else:
tsgrplist[character.corporation.ticker] = self._create_group(character.corporation.ticker) if not character.corporation.ticker in tsgrplist:
self.conn.send_command('servergroupaddclient', {'sgid': tsgrplist[character.corporation.ticker], 'cldbid': cldbid }) tsgrplist[character.corporation.ticker] = self._create_group(character.corporation.ticker)
self.conn.send_command('servergroupaddclient', {'sgid': tsgrplist[character.corporation.ticker], 'cldbid': cldbid })
# Remove OKed groups from the delete list # Remove OKed groups from the delete list
for g in groups: for g in groups: