"leave {Closed|Open} Group" => "leave group"

pull/1306/head
Audric Ackermann 5 years ago
parent 66d3a2b86c
commit e008dbd0d5
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -927,10 +927,6 @@
"message": "Permanently delete the messages in this conversation?", "message": "Permanently delete the messages in this conversation?",
"description": "Confirmation dialog text that asks the user if they really wish to delete the conversation. Answer buttons use the strings 'ok' and 'cancel'. The deletion is permanent, i.e. it cannot be undone." "description": "Confirmation dialog text that asks the user if they really wish to delete the conversation. Answer buttons use the strings 'ok' and 'cancel'. The deletion is permanent, i.e. it cannot be undone."
}, },
"leaveOpenGroupConfirmation": {
"message": "Leave this Open Group?",
"description": "Confirmation dialog text that tells the user what will happen if they leave the public channel."
},
"deleteAccount": { "deleteAccount": {
"message": "Delete Account", "message": "Delete Account",
"description": "Text for button in settings view to delete account" "description": "Text for button in settings view to delete account"
@ -1605,17 +1601,17 @@
"message": "Ban failed!", "message": "Ban failed!",
"description": "Toast on unsuccesful user ban." "description": "Toast on unsuccesful user ban."
}, },
"leaveOpenGroup": { "leaveGroup": {
"message": "Leave Open Group", "message": "Leave Group",
"description": "Button action that the user can click to leave the group" "description": "Button action that the user can click to leave the group"
}, },
"leaveClosedGroup": { "leaveClosedGroup": {
"message": "Leave Closed Group", "message": "Leave Closed Group",
"description": "Button action that the user can click to leave the group" "description": "Button action that the user can click to leave the group"
}, },
"leaveClosedGroupConfirmation": { "leaveGroupConfirmation": {
"message": "Leave this Closed Group?", "message": "Are you sure you want to leave this group?",
"description": "Confirmation dialog text that tells the user what will happen if they leave the closed group." "description": "Confirmation dialog text that tells the user what will happen if they leave the group."
}, },
"noContactsForGroup": { "noContactsForGroup": {
"message": "You don't have any contacts to start a group with." "message": "You don't have any contacts to start a group with."

@ -2302,12 +2302,15 @@
this.contactCollection.reset(contacts); this.contactCollection.reset(contacts);
}); });
}, },
// returns true if this is a closed/medium or open group
isGroup() {
return this.get('type') === 'group';
},
copyPublicKey() { copyPublicKey() {
clipboard.writeText(this.id); clipboard.writeText(this.id);
const isGroup = this.getProps().type === 'group'; const copiedMessage = this.isGroup()
const copiedMessage = isGroup
? i18n('copiedChatId') ? i18n('copiedChatId')
: i18n('copiedPublicKey'); : i18n('copiedPublicKey');
@ -2330,12 +2333,9 @@
let title = i18n('deleteContact'); let title = i18n('deleteContact');
let message = i18n('deleteContactConfirmation'); let message = i18n('deleteContactConfirmation');
if (this.isPublic()) { if (this.isGroup()) {
title = i18n('leaveOpenGroup'); title = i18n('leaveGroup');
message = i18n('leaveOpenGroupConfirmation'); message = i18n('leaveGroupConfirmation');
} else if (this.isClosedGroup()) {
title = i18n('leaveClosedGroup');
message = i18n('leaveClosedGroupConfirmation');
} }
window.confirmationDialog({ window.confirmationDialog({

@ -237,12 +237,9 @@
let title = i18n('deleteContact'); let title = i18n('deleteContact');
let message = i18n('deleteContactConfirmation'); let message = i18n('deleteContactConfirmation');
if (groupConvo.isPublic()) { if (groupConvo.isGroup()) {
title = i18n('leaveOpenGroup'); title = i18n('leaveGroup');
message = i18n('leaveOpenGroupConfirmation'); message = i18n('leaveGroupConfirmation');
} else if (groupConvo.isClosedGroup()) {
title = i18n('leaveClosedGroup');
message = i18n('leaveClosedGroupConfirmation');
} }
window.confirmationDialog({ window.confirmationDialog({

@ -223,10 +223,10 @@ export class SessionGroupSettings extends React.Component<Props, any> {
const hasDisappearingMessages = const hasDisappearingMessages =
!isPublic && !isKickedFromGroup && !isBlocked; !isPublic && !isKickedFromGroup && !isBlocked;
const leaveGroupString = isPublic const leaveGroupString = isPublic
? window.i18n('leaveOpenGroup') ? window.i18n('leaveGroup')
: isKickedFromGroup : isKickedFromGroup
? window.i18n('youGotKickedFromGroup') ? window.i18n('youGotKickedFromGroup')
: window.i18n('leaveClosedGroup'); : window.i18n('leaveGroup');
const disappearingMessagesOptions = timerOptions.map(option => { const disappearingMessagesOptions = timerOptions.map(option => {
return { return {

@ -135,7 +135,7 @@ export function getDeleteContactMenuItem(
) )
) { ) {
if (isPublic) { if (isPublic) {
return <MenuItem onClick={action}>{i18n('leaveOpenGroup')}</MenuItem>; return <MenuItem onClick={action}>{i18n('leaveGroup')}</MenuItem>;
} }
return <MenuItem onClick={action}>{i18n('deleteContact')}</MenuItem>; return <MenuItem onClick={action}>{i18n('deleteContact')}</MenuItem>;
} }
@ -158,7 +158,7 @@ export function getLeaveGroupMenuItem(
Boolean(isRss) Boolean(isRss)
) )
) { ) {
return <MenuItem onClick={action}>{i18n('leaveClosedGroup')}</MenuItem>; return <MenuItem onClick={action}>{i18n('leaveGroup')}</MenuItem>;
} }
return null; return null;
} }

Loading…
Cancel
Save