mattermost import: Fix handling of channels with no subscribers.

Previously, we skipped setting the list of subscribers to the channel,
which could result in problems if any messages had been posted there
in the past (e.g. because the channel used to have members, but now
doesn't).  It could be correct to skip importing dead channels
altogether, but probably simpler is to just set an empty subscriber list.
This commit is contained in:
Tim Abbott 2019-11-03 22:22:20 -08:00
parent dc682da47a
commit aad99ce951
1 changed files with 4 additions and 5 deletions

View File

@ -195,7 +195,6 @@ def convert_channel_data(channel_data: List[ZerverFieldsT],
for username in channel_members_map[stream_name]: for username in channel_members_map[stream_name]:
channel_users.add(user_id_mapper.get(username)) channel_users.add(user_id_mapper.get(username))
if channel_users:
subscriber_handler.set_info( subscriber_handler.set_info(
users=channel_users, users=channel_users,
stream_id=stream_id, stream_id=stream_id,