@@ -230,19 +230,22 @@ void showTopicActionSheet(BuildContext context, {
230230 final pageContext = PageRoot .contextOf (context);
231231
232232 final store = PerAccountStoreWidget .of (pageContext);
233+ final channel = store.streams[channelId];
233234 final subscription = store.subscriptions[channelId];
234235
235236 final optionButtons = < ActionSheetMenuItemButton > [];
236237
238+ final isChannelArchived = channel? .isArchived == false ;
237239 // TODO(server-7): simplify this condition away
238240 final supportsUnmutingTopics = store.zulipFeatureLevel >= 170 ;
239241 // TODO(server-8): simplify this condition away
240242 final supportsFollowingTopics = store.zulipFeatureLevel >= 219 ;
241243
242244 final visibilityOptions = < UserTopicVisibilityPolicy > [];
243245 final visibilityPolicy = store.topicVisibilityPolicy (channelId, topic);
244- if (subscription == null ) {
245- // Not subscribed to the channel; there is no user topic change to be made.
246+ if (subscription == null || ! isChannelArchived) {
247+ // Not subscribed to the channel or the channel is archived;
248+ // there is no user topic change to be made.
246249 } else if (! subscription.isMuted) {
247250 // Channel is subscribed and not muted.
248251 switch (visibilityPolicy) {
@@ -306,7 +309,8 @@ void showTopicActionSheet(BuildContext context, {
306309 // limit for editing topics).
307310 if (someMessageIdInTopic != null
308311 // ignore: unnecessary_null_comparison // null topic names soon to be enabled
309- && topic.displayName != null ) {
312+ && topic.displayName != null
313+ && isChannelArchived) {
310314 optionButtons.add (ResolveUnresolveButton (pageContext: pageContext,
311315 topic: topic,
312316 someMessageIdInTopic: someMessageIdInTopic));
@@ -564,14 +568,18 @@ void showMessageActionSheet({required BuildContext context, required Message mes
564568 final messageListPage = MessageListPage .ancestorOf (pageContext);
565569 final isComposeBoxOffered = messageListPage.composeBoxController != null ;
566570
571+ bool isInArchivedChannel = false ;
572+ if (message is StreamMessage ) {
573+ final channel = store.streams[message.streamId];
574+ isInArchivedChannel = channel? .isArchived == true ;
575+ }
567576 final isMessageRead = message.flags.contains (MessageFlag .read);
568577 final markAsUnreadSupported = store.zulipFeatureLevel >= 155 ; // TODO(server-6)
569578 final showMarkAsUnreadButton = markAsUnreadSupported && isMessageRead;
570-
571579 final optionButtons = [
572580 ReactionButtons (message: message, pageContext: pageContext),
573581 StarButton (message: message, pageContext: pageContext),
574- if (isComposeBoxOffered)
582+ if (isComposeBoxOffered && ! isInArchivedChannel )
575583 QuoteAndReplyButton (message: message, pageContext: pageContext),
576584 if (showMarkAsUnreadButton)
577585 MarkAsUnreadButton (message: message, pageContext: pageContext),
0 commit comments