Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
303 changes: 303 additions & 0 deletions __tests__/__snapshots__/Storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44404,6 +44404,309 @@ exports[`Storyshots Message list message 1`] = `
</View>
</View>
</View>
<Text
style={
Array [
Object {
"fontSize": 20,
"fontWeight": "300",
"marginLeft": 10,
"marginVertical": 30,
},
Object {
"color": "#0d0e12",
},
Object {
"marginBottom": 0,
"marginTop": 30,
},
]
}
>
Toggle e2e encryption
</Text>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
>
<View>
<View
style={
Array [
Object {
"flexDirection": "column",
"paddingHorizontal": 14,
"paddingVertical": 4,
"width": "100%",
},
undefined,
]
}
>
<View
style={
Object {
"flexDirection": "row",
}
}
>
<View
style={
Array [
Object {
"borderRadius": 2,
"height": 20,
"width": 20,
},
Object {
"marginLeft": 16,
},
]
}
>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 2,
"height": 20,
"width": 20,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"headers": undefined,
"priority": "high",
"uri": "https://open.rocket.chat/avatar/diego.mello?format=png&size=20",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
</View>
<View
style={
Array [
Object {
"flex": 1,
"marginLeft": 46,
},
Object {
"marginLeft": 10,
},
]
}
>
<Text
accessibilityLabel="This room's encryption has been disabled by diego.mello"
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 16,
"fontStyle": "italic",
"fontWeight": "400",
"textAlign": "left",
},
Object {
"color": "#9ca2a8",
},
]
}
>
This room's encryption has been disabled by diego.mello
</Text>
</View>
</View>
</View>
</View>
</View>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
>
<View>
<View
style={
Array [
Object {
"flexDirection": "column",
"paddingHorizontal": 14,
"paddingVertical": 4,
"width": "100%",
},
undefined,
]
}
>
<View
style={
Object {
"flexDirection": "row",
}
}
>
<View
style={
Array [
Object {
"borderRadius": 2,
"height": 20,
"width": 20,
},
Object {
"marginLeft": 16,
},
]
}
>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 2,
"height": 20,
"width": 20,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"headers": undefined,
"priority": "high",
"uri": "https://open.rocket.chat/avatar/diego.mello?format=png&size=20",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
</View>
<View
style={
Array [
Object {
"flex": 1,
"marginLeft": 46,
},
Object {
"marginLeft": 10,
},
]
}
>
<Text
accessibilityLabel="This room's encryption has been enabled by diego.mello"
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 16,
"fontStyle": "italic",
"fontWeight": "400",
"textAlign": "left",
},
Object {
"color": "#9ca2a8",
},
]
}
>
This room's encryption has been enabled by diego.mello
</Text>
</View>
</View>
</View>
</View>
</View>
<Text
style={
Array [
Expand Down
8 changes: 7 additions & 1 deletion app/containers/message/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export const SYSTEM_MESSAGES = [
'room_changed_privacy',
'room_changed_avatar',
'message_snippeted',
'thread-created'
'thread-created',
'room_e2e_enabled',
'room_e2e_disabled'
];

export const SYSTEM_MESSAGE_TYPES = {
Expand Down Expand Up @@ -100,6 +102,10 @@ export const getInfoMessage = ({
return I18n.t('Room_changed_avatar', { userBy: username });
} else if (type === 'message_snippeted') {
return I18n.t('Created_snippet');
} else if (type === 'room_e2e_disabled') {
return I18n.t('This_room_encryption_has_been_disabled_by__username_', { username });
} else if (type === 'room_e2e_enabled') {
return I18n.t('This_room_encryption_has_been_enabled_by__username_', { username });
}
return '';
};
Expand Down
4 changes: 3 additions & 1 deletion app/i18n/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,5 +704,7 @@ export default {
Direct_message: 'Direct message',
Message_Ignored: 'Message ignored. Tap to display it.',
Enter_workspace_URL: 'Enter workspace URL',
Workspace_URL_Example: 'Ex. your-company.rocket.chat'
Workspace_URL_Example: 'Ex. your-company.rocket.chat',
This_room_encryption_has_been_enabled_by__username_: 'This room\'s encryption has been enabled by {{username}}',
This_room_encryption_has_been_disabled_by__username_: 'This room\'s encryption has been disabled by {{username}}'
};
4 changes: 3 additions & 1 deletion app/i18n/locales/pt-BR.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,5 +651,7 @@ export default {
Direct_message: 'Mensagem direta',
Message_Ignored: 'Mensagem ignorada. Toque para mostrar.',
Enter_workspace_URL: 'Digite a URL da sua workspace',
Workspace_URL_Example: 'Ex. sua-empresa.rocket.chat'
Workspace_URL_Example: 'Ex. sua-empresa.rocket.chat',
This_room_encryption_has_been_enabled_by__username_: 'A criptografia para essa sala foi habilitada por {{username}}',
This_room_encryption_has_been_disabled_by__username_: 'A criptografia para essa sala foi desabilitada por {{username}}'
};
4 changes: 4 additions & 0 deletions storybook/stories/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,10 @@ export default ({ theme }) => {
<Separator title='Changed type' theme={theme} />
<Message msg='public' type='room_changed_privacy' isInfo />

<Separator title='Toggle e2e encryption' theme={theme} />
<Message type='room_e2e_disabled' isInfo />
<Message type='room_e2e_enabled' isInfo />

<Separator title='Ignored' theme={theme} />
<Message isIgnored />

Expand Down