-
-
Notifications
You must be signed in to change notification settings - Fork 672
Show "(guest)" by guest users' names, when setting enabled #5809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3cae733
9ebb8c7
ab219f7
95ed1ba
b032519
a4a26f1
d33f134
f35cc29
2273d56
9b46739
17eb634
7cc4d9f
47c2d94
889827b
1c0266d
8b5c507
9650e88
ee39d54
9171d7d
0c29df4
eb3fb95
e729dbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* @flow strict-local */ | ||
|
||
import type { GetText } from '../../types'; | ||
|
||
// Our translation function, usually given the name _. | ||
// eslint-disable-next-line no-underscore-dangle | ||
export const mock_: GetText = m => { | ||
if (typeof m === 'object') { | ||
if (m.text === '{_}') { | ||
// $FlowIgnore[incompatible-indexer] | ||
/* $FlowIgnore[incompatible-cast] | ||
We expect an `m.values` that corresponds to `m.text`. */ | ||
const values = (m.values: {| +_: string |}); | ||
return values._; | ||
} | ||
return m.text; | ||
} | ||
return m; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ import AnnouncementOnly from '../message/AnnouncementOnly'; | |
import MentionWarnings from './MentionWarnings'; | ||
import { | ||
getAuth, | ||
getOwnUser, | ||
getStreamInNarrow, | ||
getStreamsById, | ||
getVideoChatProvider, | ||
|
@@ -66,7 +67,7 @@ import AutocompleteView from '../autocomplete/AutocompleteView'; | |
import { getAllUsersById, getOwnUserId } from '../users/userSelectors'; | ||
import * as api from '../api'; | ||
import { ensureUnreachable } from '../generics'; | ||
import { getOwnUserRole, roleIsAtLeast } from '../permissionSelectors'; | ||
import { roleIsAtLeast } from '../permissionSelectors'; | ||
import { Role } from '../api/permissionsTypes'; | ||
import useUncontrolledInput from '../useUncontrolledInput'; | ||
import { tryFetch } from '../message/fetchActions'; | ||
|
@@ -187,15 +188,15 @@ const ComposeBox: React$AbstractComponent<Props, ImperativeHandle> = forwardRef( | |
const zulipFeatureLevel = useSelector(getZulipFeatureLevel); | ||
const ownUserId = useSelector(getOwnUserId); | ||
const allUsersById = useSelector(getAllUsersById); | ||
const isAtLeastAdmin = useSelector(state => roleIsAtLeast(getOwnUserRole(state), Role.Admin)); | ||
const isAtLeastAdmin = useSelector(state => roleIsAtLeast(getOwnUser(state).role, Role.Admin)); | ||
const isAnnouncementOnly = useSelector(state => | ||
getIsActiveStreamAnnouncementOnly(state, props.narrow), | ||
); | ||
const isSubscribed = useSelector(state => getIsActiveStreamSubscribed(state, props.narrow)); | ||
const stream = useSelector(state => getStreamInNarrow(state, props.narrow)); | ||
const streamsById = useSelector(getStreamsById); | ||
const videoChatProvider = useSelector(getVideoChatProvider); | ||
const mandatoryTopics = useSelector(state => getRealm(state).mandatoryTopics); | ||
const { mandatoryTopics, enableGuestUserIndicator } = useSelector(getRealm); | ||
|
||
const mentionWarnings = React.useRef<React$ElementRef<typeof MentionWarnings> | null>(null); | ||
|
||
|
@@ -713,7 +714,14 @@ const ComposeBox: React$AbstractComponent<Props, ImperativeHandle> = forwardRef( | |
return <AnnouncementOnly />; | ||
} | ||
|
||
const placeholder = getComposeInputPlaceholder(narrow, ownUserId, allUsersById, streamsById); | ||
const placeholder = getComposeInputPlaceholder( | ||
narrow, | ||
ownUserId, | ||
allUsersById, | ||
streamsById, | ||
enableGuestUserIndicator, | ||
_, | ||
); | ||
Comment on lines
-716
to
+724
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This parameter list has gotten increasingly ridiculous and should probably become There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. |
||
|
||
const SubmitButtonIcon = isEditing ? IconDone : IconSend; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
52f253a api [nfc]: Make UserOrBot.role required, since we require Server 4.0
I think my ideal version of this change would have been several commits:
role
always present, propagate that as far as the types require;But given that we hope to be done with this codebase soon, this is OK; no need to go back and split it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah OK, makes sense. Thanks for the feedback!