3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

classes: remove channels, modes from User.get_fields()

These don't really make sense to be formatted as a string.
This commit is contained in:
James Lu 2019-03-28 20:14:04 -07:00
parent 63d63c0137
commit 2c028e2762

View File

@ -140,12 +140,9 @@ class User(TSObject):
fields = self.__dict__.copy()
# These don't really make sense in text substitutions
for field in ('manipulatable', '_irc'):
for field in ('manipulatable', '_irc', 'channels', 'modes'):
del fields[field]
# Pre-format the channels list. FIXME: maybe this should be configurable somehow?
fields['channels'] = ','.join(sorted(self.channels))
# Swap SID and server name for convenience
fields['sid'] = self.server
try:
@ -156,9 +153,6 @@ class User(TSObject):
# Network name
fields['netname'] = self._irc.name
# Join umodes together
fields['modes'] = self._irc.join_modes(self.modes)
# Add the nick attribute; this isn't in __dict__ because it's a property
fields['nick'] = self._nick