Merge pull request #5947 from robintown/e2ee-history-visibility
Hide world readable history option in encrypted roomspull/21833/head
						commit
						f3970e201a
					
				|  | @ -347,6 +347,29 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt | |||
|         const state = client.getRoom(this.props.roomId).currentState; | ||||
|         const canChangeHistory = state.mayClientSendStateEvent('m.room.history_visibility', client); | ||||
| 
 | ||||
|         const options = [ | ||||
|             { | ||||
|                 value: HistoryVisibility.Shared, | ||||
|                 label: _t('Members only (since the point in time of selecting this option)'), | ||||
|             }, | ||||
|             { | ||||
|                 value: HistoryVisibility.Invited, | ||||
|                 label: _t('Members only (since they were invited)'), | ||||
|             }, | ||||
|             { | ||||
|                 value: HistoryVisibility.Joined, | ||||
|                 label: _t('Members only (since they joined)'), | ||||
|             }, | ||||
|         ]; | ||||
| 
 | ||||
|         // World readable doesn't make sense for encrypted rooms
 | ||||
|         if (!this.state.encrypted || history === HistoryVisibility.WorldReadable) { | ||||
|             options.unshift({ | ||||
|                 value: HistoryVisibility.WorldReadable, | ||||
|                 label: _t("Anyone"), | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         return ( | ||||
|             <div> | ||||
|                 <div> | ||||
|  | @ -357,28 +380,8 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt | |||
|                     name="historyVis" | ||||
|                     value={history} | ||||
|                     onChange={this.onHistoryRadioToggle} | ||||
|                     definitions={[ | ||||
|                         { | ||||
|                             value: HistoryVisibility.WorldReadable, | ||||
|                             disabled: !canChangeHistory, | ||||
|                             label: _t("Anyone"), | ||||
|                         }, | ||||
|                         { | ||||
|                             value: HistoryVisibility.Shared, | ||||
|                             disabled: !canChangeHistory, | ||||
|                             label: _t('Members only (since the point in time of selecting this option)'), | ||||
|                         }, | ||||
|                         { | ||||
|                             value: HistoryVisibility.Invited, | ||||
|                             disabled: !canChangeHistory, | ||||
|                             label: _t('Members only (since they were invited)'), | ||||
|                         }, | ||||
|                         { | ||||
|                             value: HistoryVisibility.Joined, | ||||
|                             disabled: !canChangeHistory, | ||||
|                             label: _t('Members only (since they joined)'), | ||||
|                         }, | ||||
|                     ]} | ||||
|                     disabled={!canChangeHistory} | ||||
|                     definitions={options} | ||||
|                 /> | ||||
|             </div> | ||||
|         ); | ||||
|  |  | |||
|  | @ -1441,11 +1441,11 @@ | |||
|     "Only people who have been invited": "Only people who have been invited", | ||||
|     "Anyone who knows the room's link, apart from guests": "Anyone who knows the room's link, apart from guests", | ||||
|     "Anyone who knows the room's link, including guests": "Anyone who knows the room's link, including guests", | ||||
|     "Changes to who can read history will only apply to future messages in this room. The visibility of existing history will be unchanged.": "Changes to who can read history will only apply to future messages in this room. The visibility of existing history will be unchanged.", | ||||
|     "Anyone": "Anyone", | ||||
|     "Members only (since the point in time of selecting this option)": "Members only (since the point in time of selecting this option)", | ||||
|     "Members only (since they were invited)": "Members only (since they were invited)", | ||||
|     "Members only (since they joined)": "Members only (since they joined)", | ||||
|     "Anyone": "Anyone", | ||||
|     "Changes to who can read history will only apply to future messages in this room. The visibility of existing history will be unchanged.": "Changes to who can read history will only apply to future messages in this room. The visibility of existing history will be unchanged.", | ||||
|     "Who can read history?": "Who can read history?", | ||||
|     "Security & Privacy": "Security & Privacy", | ||||
|     "Once enabled, encryption cannot be disabled.": "Once enabled, encryption cannot be disabled.", | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 J. Ryan Stinnett
						J. Ryan Stinnett