Skip to content

Commit

Permalink
Merge branch 'zulip:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
aritroCoder authored Dec 13, 2022
2 parents 2d3ddcf + ad0e065 commit fd6abf2
Show file tree
Hide file tree
Showing 20 changed files with 725 additions and 4,888 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.5.0",
"expo-cli": "^6.0.5",
"flow-bin": "^0.170.0",
"flow-coverage-report": "^0.8.0",
"flow-typed": "^3.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/account-info/CustomProfileFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function CustomProfileFieldRow(props: {|
let valueElement = undefined;
switch (value.displayType) {
case 'text':
valueElement = <ZulipText style={styles.valueText} text={value.text} />;
valueElement = <ZulipText selectable style={styles.valueText} text={value.text} />;
break;

case 'link':
Expand Down
1 change: 1 addition & 0 deletions src/alertWords/__tests__/alertWordsReducer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('alertWordsReducer', () => {
expect(actualState).toEqual(expectedState);
});

// TODO(#5102): Delete; see comment on implementation.
test('when no `alert_words` data is given reset state', () => {
const initialState = deepFreeze(['word']);
const action = deepFreeze({
Expand Down
10 changes: 9 additions & 1 deletion src/alertWords/alertWordsReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ export default (
return initialState;

case REGISTER_COMPLETE:
return action.data.alert_words || initialState;
return (
action.data.alert_words
// TODO(#5102): Delete fallback once we enforce any threshold for
// ancient servers we refuse to connect to. It was added in #2878
// (2018-11-16), but it wasn't clear even then, it seems, whether
// any servers actually omit the data. The API doc doesn't mention
// any servers that omit it, and our Flow types mark it required.
|| initialState
);

case EVENT_ALERT_WORDS:
return action.alert_words || initialState;
Expand Down
9 changes: 7 additions & 2 deletions src/api/eventTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @flow strict-local
*/

import type { SubsetProperties } from '../generics';
import type { BoundedDiff, SubsetProperties } from '../generics';
import { keyMirror } from '../utils/keyMirror';
import type {
CustomProfileField,
Expand All @@ -24,6 +24,7 @@ import type {
UserPresence,
UserStatusUpdate,
UserSettings,
ClientPresence,
} from './modelTypes';
import type { RealmDataForUpdate } from './realmDataTypes';

Expand Down Expand Up @@ -135,12 +136,16 @@ export type SubmessageEvent = $ReadOnly<{|
content: string,
|}>;

/** https://zulip.com/api/get-events#presence */
export type PresenceEvent = $ReadOnly<{|
...EventCommon,
type: typeof EventTypes.presence,
email: string,
server_timestamp: number,
presence: UserPresence,

// Clients are asked to compute aggregated presence; the event doesn't
// have it.
presence: BoundedDiff<UserPresence, {| +aggregated: ClientPresence |}>,
|}>;

/**
Expand Down
3 changes: 3 additions & 0 deletions src/api/initialDataTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ export type InitialDataRealmUser = $ReadOnly<{|

export type InitialDataRealmUserGroups = $ReadOnly<{|
// New in Zulip 1.8.
// TODO(#5102): In userGroupsReducer, we still have a fallback for pre-1.8
// servers; remove that, and remove the above comment, which will be
// irrelevant.
realm_user_groups: $ReadOnlyArray<UserGroup>,
|}>;

Expand Down
Loading

0 comments on commit fd6abf2

Please sign in to comment.