mirror of https://github.com/zulip/zulip.git
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:
parent
dc682da47a
commit
aad99ce951
|
@ -195,11 +195,10 @@ 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,
|
)
|
||||||
)
|
|
||||||
streams.append(stream)
|
streams.append(stream)
|
||||||
return streams
|
return streams
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue