Merge pull request #1363 from loki-project/clearnet

pull/1390/head
Audric Ackermann 5 years ago committed by GitHub
commit fa5abd8cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1441,9 +1441,6 @@
"displayNameEmpty": { "displayNameEmpty": {
"message": "Bitte wählen Sie einen Anzeigenamen" "message": "Bitte wählen Sie einen Anzeigenamen"
}, },
"newClosedGroupDescription": {
"message": "Geschlossene Gruppen unterstützen bis zu 10 Mitglieder und bieten den gleichen Schutz der Privatsphäre wie Einzelgespräche."
},
"openGroupURL": { "openGroupURL": {
"message": "Gruppen-URL öffnen" "message": "Gruppen-URL öffnen"
}, },
@ -1463,6 +1460,6 @@
"message": "Bitte wählen Sie mindestens zwei Gruppenmitglieder aus." "message": "Bitte wählen Sie mindestens zwei Gruppenmitglieder aus."
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "Eine geschlossene Gruppe kann maximal zehn Mitglieder haben." "message": "Eine geschlossene Gruppe kann maximal zwanzig Mitglieder haben."
} }
} }

@ -2124,10 +2124,6 @@
"message": "New Closed Group", "message": "New Closed Group",
"androidKey": "activity_create_closed_group_title" "androidKey": "activity_create_closed_group_title"
}, },
"newClosedGroupDescription": {
"message": "Closed groups support up to 10 members and provide the same privacy protections as one-on-one sessions.",
"androidKey": "activity_create_closed_group_explanation"
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Group Name", "message": "Group Name",
"androidKey": "GroupCreateActivity_group_name_hint", "androidKey": "GroupCreateActivity_group_name_hint",
@ -2178,7 +2174,7 @@
"androidKey": "activity_create_closed_group_not_enough_group_members_error" "androidKey": "activity_create_closed_group_not_enough_group_members_error"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "A closed group cannot have more than 10 members", "message": "A closed group cannot have more than 20 members",
"androidKey": "activity_create_closed_group_too_many_group_members_error" "androidKey": "activity_create_closed_group_too_many_group_members_error"
}, },
"noBlockedContacts": { "noBlockedContacts": {

@ -1378,9 +1378,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "Nuevo grupo cerrado" "message": "Nuevo grupo cerrado"
}, },
"newClosedGroupDescription": {
"message": "Los grupos cerrados admiten hasta 10 miembros y brindan las mismas protecciones de privacidad que las sesiones individuales."
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Nombre Del Grupo" "message": "Nombre Del Grupo"
}, },
@ -1409,6 +1406,6 @@
"message": "Por favor, elige al menos 2 miembros del grupo" "message": "Por favor, elige al menos 2 miembros del grupo"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "Un grupo cerrado no puede tener más de 10 miembros" "message": "Un grupo cerrado no puede tener más de 20 miembros"
} }
} }

@ -1378,9 +1378,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "Nouveau groupe privé" "message": "Nouveau groupe privé"
}, },
"newClosedGroupDescription": {
"message": "Les groupes privés prennent en charge jusqu'à 10 membres et offrent le même niveau de confidentialité que les sessions individuelles."
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Nom du groupe" "message": "Nom du groupe"
}, },
@ -1409,7 +1406,7 @@
"message": "Veuillez sélectionner au moins 2 membres" "message": "Veuillez sélectionner au moins 2 membres"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "Un groupe privé ne peut pas avoir plus de 10 membres" "message": "Un groupe privé ne peut pas avoir plus de 20 membres"
}, },
"contextMenuNoSuggestions": { "contextMenuNoSuggestions": {
"message": "Pas de suggestions", "message": "Pas de suggestions",

@ -1372,9 +1372,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "Grup tertutup baru" "message": "Grup tertutup baru"
}, },
"newClosedGroupDescription": {
"message": "Grup tertutup maksimal berisi 10 anggota dan memiliki perlindungan privasi yang sama dengan Session antara dua pengguna"
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Nama grup" "message": "Nama grup"
}, },
@ -1403,7 +1400,7 @@
"message": "Pilih setidaknya 2 anggota grup" "message": "Pilih setidaknya 2 anggota grup"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "Grup tertutup maksimal berisi 10 anggota" "message": "Grup tertutup maksimal berisi 20 anggota"
}, },
"noBlockedContacts": { "noBlockedContacts": {
"message": "Tidak ada kontak yang diblokir" "message": "Tidak ada kontak yang diblokir"

@ -1378,9 +1378,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "Nuovo gruppo chiuso" "message": "Nuovo gruppo chiuso"
}, },
"newClosedGroupDescription": {
"message": "I gruppi chiusi supportano fino a 10 membri e forniscono le stesse protezioni per la privacy delle sessioni one-to-one."
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Nome Del Gruppo" "message": "Nome Del Gruppo"
}, },
@ -1409,6 +1406,6 @@
"message": "Scegli almeno 2 membri del gruppo" "message": "Scegli almeno 2 membri del gruppo"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "Un gruppo chiuso non può avere più di 10 membri" "message": "Un gruppo chiuso non può avere più di 20 membri"
} }
} }

@ -1378,9 +1378,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "新しいクローズドグループ" "message": "新しいクローズドグループ"
}, },
"newClosedGroupDescription": {
"message": "クローズドグループは最大 10 人のメンバーをサポートし、1 対 1 の Session と同じプライバシー保護を提供します。"
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "グループ名" "message": "グループ名"
}, },
@ -1409,7 +1406,7 @@
"message": "グループメンバーを少なくとも 2 人選択してください" "message": "グループメンバーを少なくとも 2 人選択してください"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "閉じたグループは 10 人を超えるメンバーを抱えることはできません" "message": "閉じたグループは 20 人を超えるメンバーを抱えることはできません"
}, },
"noBlockedContacts": { "noBlockedContacts": {
"message": "ブロックしている連絡先はありません" "message": "ブロックしている連絡先はありません"

@ -1378,9 +1378,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "Nowa grupa zamknięta" "message": "Nowa grupa zamknięta"
}, },
"newClosedGroupDescription": {
"message": "Grupy zamknięte obsługują do 10 członków i zapewniają taką samą ochronę prywatności jak sesje jeden na jednego."
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Nazwa grupy" "message": "Nazwa grupy"
}, },
@ -1406,7 +1403,7 @@
"message": "Wprowadź krótszą nazwę grupy" "message": "Wprowadź krótszą nazwę grupy"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "Grupa zamknięta nie może mieć więcej niż 10 członków" "message": "Grupa zamknięta nie może mieć więcej niż 20 członków"
}, },
"noBlockedContacts": { "noBlockedContacts": {
"message": "Brak zablokowanych kontaktów" "message": "Brak zablokowanych kontaktów"

@ -1378,9 +1378,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "Novo grupo fechado" "message": "Novo grupo fechado"
}, },
"newClosedGroupDescription": {
"message": "Grupos fechados suportam até 10 membros e fornecem as mesmas proteções de privacidade que as sessões individuais."
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Nome Do Grupo" "message": "Nome Do Grupo"
}, },
@ -1409,6 +1406,6 @@
"message": "Escolha pelo menos 2 membros do grupo" "message": "Escolha pelo menos 2 membros do grupo"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "Um grupo fechado não pode ter mais de 10 membros" "message": "Um grupo fechado não pode ter mais de 20 membros"
} }
} }

@ -1378,9 +1378,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "Новая закрытая группа" "message": "Новая закрытая группа"
}, },
"newClosedGroupDescription": {
"message": "Закрытые группы поддерживают до 10 участников и обеспечивают те же меры защиты конфиденциальности, что и сессии один-на-один."
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Название Группы" "message": "Название Группы"
}, },
@ -1409,7 +1406,7 @@
"message": "Пожалуйста, выберите как минимум 1 участников группы" "message": "Пожалуйста, выберите как минимум 1 участников группы"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "В закрытой группе не может быть больше 10 участников" "message": "В закрытой группе не может быть больше 20 участников"
}, },
"contextMenuNoSuggestions": { "contextMenuNoSuggestions": {
"message": "No Suggestions", "message": "No Suggestions",

@ -1339,9 +1339,6 @@
"newClosedGroup": { "newClosedGroup": {
"message": "Nhóm kín mới" "message": "Nhóm kín mới"
}, },
"newClosedGroupDescription": {
"message": "Nhóm kín hỗ trợ tối đa 10 thành viên và cung cấp dịch vụ bảo mật giống như các session một-một"
},
"createClosedGroupNamePrompt": { "createClosedGroupNamePrompt": {
"message": "Tên nhóm" "message": "Tên nhóm"
}, },
@ -1367,6 +1364,6 @@
"message": "Vui lòng chọn ít nhất 2 thành viên trong nhóm" "message": "Vui lòng chọn ít nhất 2 thành viên trong nhóm"
}, },
"closedGroupMaxSize": { "closedGroupMaxSize": {
"message": "Một nhóm kín không thể có nhiều hơn 10 thành viên" "message": "Một nhóm kín không thể có nhiều hơn 20 thành viên"
} }
} }

@ -991,22 +991,21 @@
return; return;
} }
const serverAPI = await window.lokiPublicChatAPI.findOrCreateServer(
sslServerUrl
);
if (!serverAPI) {
window.log.warn(`Could not connect to ${serverAddress}`);
return;
}
const conversation = await ConversationController.getOrCreateAndWait( const conversation = await ConversationController.getOrCreateAndWait(
conversationId, conversationId,
'group' 'group'
); );
serverAPI.findOrCreateChannel(channelId, conversationId);
await conversation.setPublicSource(sslServerUrl, channelId); await conversation.setPublicSource(sslServerUrl, channelId);
const channelAPI = await window.lokiPublicChatAPI.findOrCreateChannel(
sslServerUrl,
channelId,
conversationId
);
if (!channelAPI) {
window.log.warn(`Could not connect to ${serverAddress}`);
return;
}
appView.openConversation(conversationId, {}); appView.openConversation(conversationId, {});
} }
); );

@ -270,7 +270,6 @@
}; };
}; };
const getGroupSettingsProps = () => { const getGroupSettingsProps = () => {
const ourPK = window.textsecure.storage.user.getNumber();
const members = this.model.get('members') || []; const members = this.model.get('members') || [];
return { return {
@ -281,7 +280,7 @@
avatarPath: this.model.getAvatarPath(), avatarPath: this.model.getAvatarPath(),
isGroup: !this.model.isPrivate(), isGroup: !this.model.isPrivate(),
isPublic: this.model.isPublic(), isPublic: this.model.isPublic(),
isAdmin: this.model.get('groupAdmins').includes(ourPK), isAdmin: true, // allow closed group edits from anyone this.model.get('groupAdmins').includes(ourPK),
isRss: this.model.isRss(), isRss: this.model.isRss(),
memberCount: members.length, memberCount: members.length,
amMod: this.model.isModerator( amMod: this.model.isModerator(

@ -21,9 +21,8 @@
this.members = groupConvo.get('members') || []; this.members = groupConvo.get('members') || [];
this.avatarPath = groupConvo.getAvatarPath(); this.avatarPath = groupConvo.getAvatarPath();
const ourPK = textsecure.storage.user.getNumber(); // any member can update a closed group name
this.isAdmin = true;
this.isAdmin = groupConvo.get('groupAdmins').includes(ourPK);
// public chat settings overrides // public chat settings overrides
if (this.isPublic) { if (this.isPublic) {
@ -79,7 +78,6 @@
Whisper.UpdateGroupMembersDialogView = Whisper.View.extend({ Whisper.UpdateGroupMembersDialogView = Whisper.View.extend({
className: 'loki-dialog modal', className: 'loki-dialog modal',
initialize(groupConvo) { initialize(groupConvo) {
const ourPK = textsecure.storage.user.getNumber();
this.groupName = groupConvo.get('name'); this.groupName = groupConvo.get('name');
this.close = this.close.bind(this); this.close = this.close.bind(this);
this.onSubmit = this.onSubmit.bind(this); this.onSubmit = this.onSubmit.bind(this);
@ -99,7 +97,8 @@
this.existingMembers = []; this.existingMembers = [];
} else { } else {
this.titleText = i18n('updateGroupDialogTitle', this.groupName); this.titleText = i18n('updateGroupDialogTitle', this.groupName);
this.isAdmin = groupConvo.get('groupAdmins').includes(ourPK); // anybody can edit a closed group name or members
this.isAdmin = true;
const convos = window.getConversations().models.filter(d => !!d); const convos = window.getConversations().models.filter(d => !!d);
this.existingMembers = groupConvo.get('members') || []; this.existingMembers = groupConvo.get('members') || [];

@ -80,12 +80,9 @@
// Do not trigger an update if there is too many members // Do not trigger an update if there is too many members
if ( if (
newMembers.length + existingMembers.length > newMembers.length + existingMembers.length >
window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT window.CONSTANTS.MEDIUM_GROUP_SIZE_LIMIT
) { ) {
const msg = window.i18n( const msg = window.i18n('closedGroupMaxSize');
'closedGroupMaxSize',
window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT
);
window.pushToast({ window.pushToast({
title: msg, title: msg,

@ -2,7 +2,7 @@
"name": "session-messenger-desktop", "name": "session-messenger-desktop",
"productName": "Session", "productName": "Session",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"version": "1.3.1", "version": "1.4.0",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Loki Project", "name": "Loki Project",

@ -86,7 +86,7 @@ window.CONSTANTS = new (function() {
this.MAX_CONNECTION_DURATION = 5000; this.MAX_CONNECTION_DURATION = 5000;
this.MAX_MESSAGE_BODY_LENGTH = 64 * 1024; this.MAX_MESSAGE_BODY_LENGTH = 64 * 1024;
// Limited due to the proof-of-work requirement // Limited due to the proof-of-work requirement
this.SMALL_GROUP_SIZE_LIMIT = 10; this.MEDIUM_GROUP_SIZE_LIMIT = 20;
// Number of seconds to turn on notifications after reconnect/start of app // Number of seconds to turn on notifications after reconnect/start of app
this.NOTIFICATION_ENABLE_TIMEOUT_SECONDS = 10; this.NOTIFICATION_ENABLE_TIMEOUT_SECONDS = 10;
this.SESSION_ID_LENGTH = 66; this.SESSION_ID_LENGTH = 66;
@ -451,7 +451,7 @@ window.lokiFeatureFlags = {
useSnodeProxy: !process.env.USE_STUBBED_NETWORK, useSnodeProxy: !process.env.USE_STUBBED_NETWORK,
useOnionRequests: true, useOnionRequests: true,
useFileOnionRequests: true, useFileOnionRequests: true,
enableSenderKeys: false, enableSenderKeys: true,
onionRequestHops: 3, onionRequestHops: 3,
debugMessageLogs: process.env.ENABLE_MESSAGE_LOGS, debugMessageLogs: process.env.ENABLE_MESSAGE_LOGS,
useMultiDevice: false, useMultiDevice: false,
@ -490,7 +490,7 @@ if (config.environment.includes('test-integration')) {
useOnionRequests: false, useOnionRequests: false,
useFileOnionRequests: false, useFileOnionRequests: false,
debugMessageLogs: true, debugMessageLogs: true,
enableSenderKeys: false, enableSenderKeys: true,
useMultiDevice: false, useMultiDevice: false,
}; };
/* eslint-disable global-require, import/no-extraneous-dependencies */ /* eslint-disable global-require, import/no-extraneous-dependencies */

@ -656,6 +656,10 @@ label {
} }
} }
.group-member-list__selection {
overflow-y: auto;
}
&__centered { &__centered {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -1423,15 +1427,8 @@ input {
text-align: center; text-align: center;
padding: 20px; padding: 20px;
} }
// Height at which scroll bar appears on the group member list
@media (max-height: 804px) {
&__container {
overflow-y: visible;
max-height: none;
}
}
} }
.create-group-name-input { .create-group-name-input {
display: flex; display: flex;
justify-content: center; justify-content: center;

@ -83,7 +83,7 @@ async function createClosedGroup(
}); });
return; return;
} else if (groupMembers.length >= window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT) { } else if (groupMembers.length >= window.CONSTANTS.MEDIUM_GROUP_SIZE_LIMIT) {
ToastUtils.push({ ToastUtils.push({
title: window.i18n('closedGroupMaxSize'), title: window.i18n('closedGroupMaxSize'),
type: 'error', type: 'error',

@ -8,7 +8,7 @@ import { createLegacyGroup } from '../../session/medium_group';
declare global { declare global {
interface Window { interface Window {
Lodash: any; Lodash: any;
SMALL_GROUP_SIZE_LIMIT: number; MEDIUM_GROUP_SIZE_LIMIT: number;
} }
} }
@ -200,11 +200,9 @@ export class CreateGroupDialog extends React.Component<Props, State> {
if ( if (
updatedContacts.filter(d => d.checkmarked).length > updatedContacts.filter(d => d.checkmarked).length >
window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT - 1 window.CONSTANTS.MEDIUM_GROUP_SIZE_LIMIT - 1
) { ) {
const msg = `${this.props.i18n('closedGroupMaxSize')} ${ const msg = this.props.i18n('closedGroupMaxSize');
window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT
}`;
this.onShowError(msg); this.onShowError(msg);
return; return;

@ -151,7 +151,6 @@ export class SessionClosableOverlay extends React.Component<Props, State> {
case 'closed-group': case 'closed-group':
title = window.i18n('newClosedGroup'); title = window.i18n('newClosedGroup');
buttonText = window.i18n('done'); buttonText = window.i18n('done');
descriptionLong = window.i18n('newClosedGroupDescription');
subtitle = window.i18n('createClosedGroupNamePrompt'); subtitle = window.i18n('createClosedGroupNamePrompt');
placeholder = window.i18n('createClosedGroupPlaceholder'); placeholder = window.i18n('createClosedGroupPlaceholder');
break; break;

@ -245,7 +245,7 @@ class SessionGroupSettings extends React.Component<Props, any> {
const showUpdateGroupNameButton = const showUpdateGroupNameButton =
isPublic && !isKickedFromGroup isPublic && !isKickedFromGroup
? amMod && !isBlocked ? amMod && !isBlocked
: isAdmin && !isBlocked; : isAdmin && !isBlocked && !isKickedFromGroup;
const showUpdateGroupMembersButton = const showUpdateGroupMembersButton =
!isPublic && !isKickedFromGroup && !isBlocked && isAdmin; !isPublic && !isKickedFromGroup && !isBlocked && isAdmin;

@ -85,9 +85,8 @@ export async function preprocessGroupMessage(
if (newGroup) { if (newGroup) {
conversation.updateGroupAdmins(group.admins); conversation.updateGroupAdmins(group.admins);
} else { } else {
// be sure to drop a message from a non admin if it tries to change group members // group members and names can be changed from any member
// or change the group name const fromAdmin = true;
const fromAdmin = conversation.get('groupAdmins').includes(primarySource);
if (!fromAdmin) { if (!fromAdmin) {
// Make sure the message is not removing members / renaming the group // Make sure the message is not removing members / renaming the group

@ -308,7 +308,7 @@ async function handleMediumGroupChange(
} }
// // Check that the sender is admin (make sure it words with multidevice) // // Check that the sender is admin (make sure it words with multidevice)
const isAdmin = curAdmins.includes(senderIdentity); const isAdmin = true;
if (!isAdmin) { if (!isAdmin) {
log.warn('Rejected attempt to update a group by non-admin'); log.warn('Rejected attempt to update a group by non-admin');
@ -317,7 +317,7 @@ async function handleMediumGroupChange(
} }
// NOTE: right now, we don't expect admins to change // NOTE: right now, we don't expect admins to change
const admins = adminsBinary.map(toHex); // const admins = adminsBinary.map(toHex);
const members = membersBinary.map(toHex); const members = membersBinary.map(toHex);
const diff = SenderKeyAPI.calculateGroupDiff(convo, { name, members }); const diff = SenderKeyAPI.calculateGroupDiff(convo, { name, members });

@ -37,9 +37,13 @@ export class ExpirationTimerUpdateMessage extends DataMessage {
if (this.groupId) { if (this.groupId) {
const groupMessage = new SignalService.GroupContext(); const groupMessage = new SignalService.GroupContext();
groupMessage.id = new Uint8Array( let groupIdWithPrefix: string = this.groupId.key;
StringUtils.encode(this.groupId.key, 'utf8') if (!this.groupId.key.startsWith(PubKey.PREFIX_GROUP_TEXTSECURE)) {
); groupIdWithPrefix = PubKey.PREFIX_GROUP_TEXTSECURE + this.groupId.key;
}
const encoded = StringUtils.encode(groupIdWithPrefix, 'utf8');
const id = new Uint8Array(encoded);
groupMessage.id = id;
groupMessage.type = SignalService.GroupContext.Type.DELIVER; groupMessage.type = SignalService.GroupContext.Type.DELIVER;
data.group = groupMessage; data.group = groupMessage;

@ -327,6 +327,15 @@ export async function storeOnNode(
return false; return false;
} else if (e instanceof textsecure.WrongDifficultyError) { } else if (e instanceof textsecure.WrongDifficultyError) {
const { newDifficulty } = e; const { newDifficulty } = e;
// difficulty of 100 happens when a snode restarts. We have to exit the loop and markNodeUnreachable()
if (newDifficulty === 100) {
log.warn(
'loki_message:::storeOnNode - invalid new difficulty:100. Marking node as bad.'
);
successiveFailures = MAX_ACCEPTABLE_FAILURES;
continue;
}
if (!Number.isNaN(newDifficulty)) { if (!Number.isNaN(newDifficulty)) {
window.storage.put('PoWDifficulty', newDifficulty); window.storage.put('PoWDifficulty', newDifficulty);
} }

Loading…
Cancel
Save