Skip to content

Conversation

chrisbobbe
Copy link
Collaborator

@chrisbobbe chrisbobbe commented Jul 2, 2025

I noticed this while working on #1555.

Fixes #1651.

Before After
Screenshot 2025-07-01 at 5 22 34 PM Screenshot 2025-07-01 at 5 27 04 PM

@chrisbobbe chrisbobbe requested a review from rajveermalviya July 2, 2025 00:25
@chrisbobbe chrisbobbe added a-compose Compose box, autocomplete, attaching files/images maintainer review PR ready for review by Zulip maintainers labels Jul 2, 2025
Copy link
Member

@rajveermalviya rajveermalviya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chrisbobbe! LGTM.

@rajveermalviya rajveermalviya added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Jul 2, 2025
@rajveermalviya rajveermalviya requested a review from gnprice July 2, 2025 20:11
user: store.selfUser, byDate: DateTime.now())) {
if (
channel == null
|| (channel.inviteOnly && channel is! Subscription)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh interesting. Is this the right logic?

You could be viewing a channel that's private, you're not subscribed, but you have content access to (now that that's a thing). In that case I'd expect the rule for whether you can post to be the same as it is for a public channel.

Copy link
Collaborator Author

@chrisbobbe chrisbobbe Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have content access to (now that that's a thing)

Are you thinking of shared vs. protected history, or is there a newer feature than that that I'm not aware of?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one: https://zulip.com/help/configure-who-can-subscribe

This permission grants access to channel content: users who are allowed to subscribe to a channel will also be able to read messages in it without subscribing.

It looks like in order to send, one then has to actually subscribe:

A designer on the team could then follow a link to a conversation in the private engineering channel, and read it without subscribing. They could subscribe if they need to send a message there, without asking for help.

Seems like a wart that that's different from the behavior for public channels, though. And ISTR a recent chat thread where either Alya or Tim said that behavior for public channels was likely to change.

I think the upshot is:

  • this logic should live somewhere more central, in model code; probably within the hasPostingPermission method (which in turn should ultimately be on ChannelStore, after other refactors);
  • the public-vs-private quirk should get a comment pointing to the help page and/or to a relevant chat thread;
  • let's finish taking care of search and some other priorities before returning to finish this 🙂

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zulip/zulip#21433 has some work by a current GSoC participant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like in order to send, one then has to actually subscribe:

A designer on the team could then follow a link to a conversation in the private engineering channel, and read it without subscribing. They could subscribe if they need to send a message there, without asking for help.

Seems like a wart that that's different from the behavior for public channels, though.

I think that note in the doc makes sense for frontend users, because frontend hasn't implemented sending at all when unsubscribed, even when you have permission: zulip/zulip#35902. (That issue supersedes the one Alya linked to here.)

I don't think the server actually prohibits sending to all unsubscribed private channels though. There's no note about that in the "Channel posting policy" Help Center doc; I read that doc as saying that can_send_message_group is the only thing that controls whether you can send messages in a channel.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of #1863 being merged, we do now respect can_send_message_group, when present, so I think there's nothing more to do here and I'll close this.

@gnprice gnprice added this to the M7: Future milestone Jul 3, 2025
@gnprice
Copy link
Member

gnprice commented Jul 3, 2025

(Propagated the milestone from the issue.)

@chrisbobbe
Copy link
Collaborator Author

Indeed, I didn't have the right logic in mind when writing this, but I think we do now have the right logic, implemented in #1863 (see #1652 (comment)), so I'll close this.

@chrisbobbe chrisbobbe closed this Oct 9, 2025
@chrisbobbe chrisbobbe deleted the pr-hide-compose-private-unsubscribed branch October 9, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a-compose Compose box, autocomplete, attaching files/images integration review Added by maintainers when PR may be ready for integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compose: Hide compose box for private, unsubscribed channels

4 participants