Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed group chunk3 #3052

Open
wants to merge 144 commits into
base: unstable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
53fca2a
fix: text for note to self delete from all my devices
Bilb Aug 21, 2023
5b2580c
feat: add poller changes and closed group keypair gen
Bilb Aug 23, 2023
db98cc2
feat: able to create a broken closedgroup v3
Bilb Sep 7, 2023
f23c525
feat: add protobuf changes for new groups
Bilb Sep 7, 2023
a7acba8
chore: cleanup protobuf to spaces indent
Bilb Sep 7, 2023
8c3b650
fix: wip before removing info+members+keys from protobuf kinds
Bilb Sep 11, 2023
4291337
fix: remove groups from protobuf
Bilb Sep 11, 2023
f86b368
fix: add GroupSyncJob to push changes for group
Bilb Sep 12, 2023
d89ff59
feat: store info+members+keys on right namespaces for groups
Bilb Sep 13, 2023
be50aa7
feat: add support for retrieve signs with admin key of group
Bilb Sep 13, 2023
90f4dd7
feat: add meta merge and update of name+members
Bilb Sep 14, 2023
08164f2
feat: add sending and receiving of libsession encrypted msgs
Bilb Sep 15, 2023
bbedfd9
fix: do not confirm keys once pushed, wait for poll event
Bilb Sep 18, 2023
46e3675
feat: add function to redux to grab group detail outside of store
Bilb Sep 19, 2023
197383a
feat: move some the convomodel.get attributes to functions
Bilb Sep 19, 2023
9191c34
feat: mark us as admin and others as invite pending
Bilb Sep 19, 2023
1a18054
feat: add bump of config hashes for groups when we have admin key
Bilb Sep 20, 2023
cd17a08
chore: lint
Bilb Sep 20, 2023
b532645
feat: preload name of group from usergroup wrapper
Bilb Sep 21, 2023
e220aee
feat: add working encrypt/decrypt for 03 group with libsession
Bilb Sep 21, 2023
1dc5224
test: added unit tests for pubkeys constructor checks
Bilb Sep 21, 2023
820103b
chore: refactor snodesignature input args type
Bilb Sep 21, 2023
e8e0e19
chore: added tests for SnodeSignatures calls
Bilb Sep 22, 2023
d12071f
chore: big rename of convocontroller to convohub
Bilb Sep 26, 2023
e69c5c4
chore: fixed unit tests
Bilb Sep 27, 2023
cc7e6f0
test: add tests for swarmPolling of new groups 03
Bilb Sep 27, 2023
9cf5d4d
test: add unit tests for encrypting/decryption groups messages
Bilb Oct 2, 2023
cf44ea1
test: added tests for group info get/set
Bilb Oct 2, 2023
e24ec9e
test: added tests for metagroup members wrapper
Bilb Oct 3, 2023
6b3adff
test: added a (still broken) test for key conflicts
Bilb Oct 3, 2023
5120542
test: add tests for GroupSyncJob
Bilb Oct 9, 2023
0ef2df8
test: speedup onion tests by stubbing retries timeout
Bilb Oct 9, 2023
d9300e6
fix: remove the whole kind logic and use namespace instead
Bilb Oct 10, 2023
c142762
chore: merged what can be between user and group sync job
Bilb Oct 10, 2023
eb77c50
chore: renamed GroupConfigurationJob to GroupSyncJob
Bilb Oct 11, 2023
d134da3
chore: renamed ConfigurationSyncJob to UserSyncJob
Bilb Oct 11, 2023
ceffa1e
test: add tests for pendingchangesforus
Bilb Oct 11, 2023
9492fdc
fix: first working test ios to desktop
Bilb Oct 12, 2023
ae67215
test: finished tests for userSyncJob
Bilb Oct 12, 2023
2ee4cad
chore: move mocha config to .mocharc.yml to package.json is cleaner
Bilb Oct 13, 2023
8445139
Merge remote-tracking branch 'upstream/unstable' into closed-group-ch…
Bilb Oct 13, 2023
b0e3867
chore: rename all groupv3 to groupv2
Bilb Oct 15, 2023
0b4f9b2
chore: rename useSelectedisNoteToSelf to useSelectedIsNoteToSelf
Bilb Oct 15, 2023
28d99a0
chore: lint
Bilb Oct 16, 2023
ed16e9b
Merge remote-tracking branch 'upstream/unstable' into closed-group-ch…
Bilb Oct 17, 2023
df3a188
fix: address PR reviews
Bilb Oct 17, 2023
0fbb0cc
chore: merge ReceiptMessage and readReceiptMessage into one
Bilb Oct 18, 2023
c9b2d69
fix: remove all of the ConfiguratioMessage (legacy) logic
Bilb Oct 19, 2023
dbe94f2
feat: added strings for groupv2 control message and components for them
Bilb Oct 20, 2023
e280191
chore: cleaned up window.d.ts
Bilb Oct 22, 2023
6ed74c9
feat: move profile details of group invite to use the one in dataMsg
Bilb Oct 24, 2023
d7608c4
feat: add building and sending of invite messages
Bilb Oct 24, 2023
b8876eb
feat: add subaccount auth
Bilb Oct 26, 2023
f17beaf
feat: add GroupInviteJob
Bilb Oct 26, 2023
1dbcd15
feat: add invite failed toast debounced
Bilb Oct 27, 2023
8274712
feat: add member status from wrapper when we are an admin
Bilb Nov 1, 2023
f9502b4
fix: remove titles from toasts
Bilb Nov 1, 2023
5adfe2e
feat: add revoke/unrevoke subrequests
Bilb Nov 1, 2023
16e7ee1
feat: make groupv2 messages skip cache
Bilb Nov 8, 2023
9595f09
fix: add setadmin on promote accepts
Bilb Nov 13, 2023
93d87d8
chore: renamed getnowwithnetworkoffset to now()
Bilb Nov 14, 2023
08c5f76
fix: store envelopetimestamp in cache, and make sure we use network one
Bilb Nov 14, 2023
bbb376f
fix: mark SharedConfigMessage as reserved
Bilb Nov 14, 2023
b259d18
fix: add still broken promote handling with set_sig_keys
Bilb Nov 15, 2023
f4fc803
fix: hide composition box when canWrite is false
Bilb Nov 16, 2023
315bc3e
fix: when promoted call loadAdminKeys
Bilb Nov 16, 2023
e5c76d3
feat: group message requests kind of working
Bilb Nov 22, 2023
ba513b2
fix: fallback when we have an invite state without who invited us
Bilb Jan 3, 2024
6d81f5f
Merge remote-tracking branch 'yougotwill/userconfig_disappearingmessa…
Bilb Jan 5, 2024
3eac45d
chore: commit updated yarn.lock
Bilb Jan 5, 2024
d839ff9
chore: resolve compilation errors
Bilb Jan 5, 2024
c21f1a7
chore: cleaned up proto to ts classes
Bilb Jan 7, 2024
8b7ce7f
Merge remote-tracking branch 'yougotwill/userconfig_disappearingmessa…
Bilb Jan 9, 2024
4357f5c
Merge remote-tracking branch 'yougotwill/userconfig_disappearingmessa…
Bilb Jan 9, 2024
77fdc97
feat: force group msg request unread when handling invite
Bilb Jan 10, 2024
3224fec
feat: marking pending member as invited when he sends a message to group
Bilb Jan 10, 2024
0be10d1
fix: move revoke unrevoke to batched push group changes
Bilb Jan 17, 2024
1b50715
fix: wrap groupUpdatesMsg into Envelope before encryption
Bilb Jan 17, 2024
528d15b
fix: fix convo volatile updates for 03-groups
Bilb Jan 18, 2024
77a62e8
fix: add avatar change message handling
Bilb Jan 19, 2024
456df58
chore: refactor messageSender.send to take an object
Bilb Jan 19, 2024
4e8ca31
fix: remove isLeft flag as we can't have a left and unremoved group
Bilb Jan 21, 2024
153846a
fix: add better typings for groupUpdateMessages
Bilb Jan 21, 2024
13da2b5
fix: add way to render group update add with history
Bilb Jan 23, 2024
d3ed798
chore: show toast when trying to remove admin of groupv2
Bilb Jan 24, 2024
6094e72
chore: move getExpiries request to class
Bilb Jan 24, 2024
5509dc7
refactor: move subrequests to classes and fix updateMessages
Bilb Jan 31, 2024
fda6ca3
fix: allow contacts without didApproveMe to be invited to group
Bilb Feb 1, 2024
f6bffc8
feat: add suppport in groupv2 of disappear v2 messages
Bilb Feb 1, 2024
2371dba
Merge branch 'unstable' into closed-group-chunk2
Bilb Feb 12, 2024
1c6182a
Merge branch 'closed-group-chunk2' of github.com:Bilb/session-desktop…
Bilb Feb 12, 2024
5e3f968
fix: merge issues
Bilb Feb 13, 2024
392e243
feat: add the sending state to invite&promote actions
Bilb Feb 13, 2024
8d0bd84
feat: add toggle to share history or not with invite group v2
Bilb Feb 13, 2024
5d467fd
feat: add way to autoregister with env variables
Bilb Feb 18, 2024
95cd0e8
Merge remote-tracking branch 'upstream/unstable' into closed-group-ch…
Bilb Feb 18, 2024
0a4e304
fix: leave group v2 as only admin mark it as deleted and pushes to swarm
Bilb Feb 19, 2024
5867c5a
fix: added type for all accessibility ids with react.d.ts
Bilb Feb 22, 2024
b9da60a
fix: send msg to group unapproved accepts and then sends message
Bilb Feb 26, 2024
a532993
chore: fix unit tests with group chunk2
Bilb Feb 27, 2024
665f6df
test: add test ofr SnodeAPI.buildRetrieveRequests
Bilb Feb 28, 2024
a83e44e
chore: rename onion requests not having retries
Bilb Feb 28, 2024
d6d9bec
fix: fixed a bunch of groupv2 chunk2 issues
Bilb Mar 11, 2024
1be8564
Merge remote-tracking branch 'upstream/clearnet' into closed-group-ch…
Bilb Mar 12, 2024
1c58899
fix: rekey explicitely when creating a group
Bilb Mar 14, 2024
74f36c8
test: fix unit test with rekey explicit needed
Bilb Mar 14, 2024
5185769
chore: update to libsession-util-nodejs 0.4.2
Bilb Mar 14, 2024
2e3026e
Merge remote-tracking branch 'upstream/unstable' into closed-group-ch…
Bilb Mar 14, 2024
8be63b1
chore: remove pify package barely used
Bilb Mar 15, 2024
bd6f5e6
feat: refacto GroupUpdateName to be functional component
Bilb Mar 15, 2024
ba7fc42
fix: groupAdmins for communities taken into account
Bilb Mar 15, 2024
2b53d10
fix: cleaned up UpdateGroupNameDialog css
Bilb Mar 15, 2024
df586d6
fix: mark a synced groupUpdate as sent
Bilb Mar 15, 2024
cbccc8c
fix: notification text based on msg content
Bilb Mar 18, 2024
c180e45
fix: add handling of deleteMsgs and deleteAttachmentsBefore for groups
Bilb Mar 18, 2024
72396cf
feat: fix message attachment cleanup and handle group attach+msg delete
Bilb Mar 18, 2024
05215d8
fix: drop incoming msg if deleteBefore says so
Bilb Mar 19, 2024
d4f3c7f
feat: add ability to unsend messages in groupv2
Bilb Mar 21, 2024
d282875
fix: make the delete by author/hashes with adminSig work
Bilb Mar 21, 2024
23a0fd6
chore: force type of backbone models id:string
Bilb Mar 21, 2024
626e2a3
fix: unsend in group: only apply change for msg sent before sig_ts
Bilb Mar 22, 2024
3b8fd82
feat: add multiencrypt/decrypt unit test
Bilb Mar 25, 2024
1796e82
fix: add handling of revoked namespace messages
Bilb May 21, 2024
6f7e576
feat: add notice banner for deprecating group and inviting users
Bilb May 22, 2024
6e137fe
Merge remote-tracking branch 'upstream/unstable' into closed-group-ch…
Bilb May 27, 2024
176f125
chore: working deps after merge
Bilb Jun 3, 2024
2ec6c7f
feat: handle isDestroyed flag + "you were removed from XXX"
Bilb Jun 4, 2024
0a3d71f
feat: delete msg on swarm when admin receives member request
Bilb Jun 4, 2024
9d9844a
feat: make group v2 control messages disappear
Bilb Jun 7, 2024
e42be00
feat: cleaned up accept/block/decline logic
Bilb Jun 11, 2024
1aa9091
feat: call swarm_verify_subaccount when receiving an invite
Bilb Jun 11, 2024
8ce5f6f
fix: don't drop groupUpdateMessages from a blocked user
Bilb Jun 11, 2024
7826dff
fix: use values from db and not libsession when inserting into wrappers
Bilb Jun 11, 2024
9b124d3
fix: featureFlag to show some buttons/toggle for QA of group chunk3
Bilb Jun 11, 2024
cd122c7
fix: make pushChangesToGroupSwarm take an extraStoreRequest
Bilb Jun 12, 2024
816f29d
chore: moved outgoing message wrapper functions to MessagWrapper.ts
Bilb Jun 12, 2024
a49a65c
chore: cleaned up the batch sender
Bilb Jun 13, 2024
59a4048
fix: cleaned up SnodeRequestTypes and made sup_keys a single item
Bilb Jun 13, 2024
a9122be
fix: clean up sending pipeline with a single array of requests
Bilb Jun 17, 2024
d6cb399
chore: matched designs better for the NoticeBanner
Bilb Jun 25, 2024
102e05d
fix: small padding inconsistency between TextNotification usage
Bilb Jun 25, 2024
d2af48f
fix: groupKeys needs to be sent first, so with an negative requestOrder
Bilb Jun 25, 2024
95cd940
fix: make the UI more responsive to GroupInvite retries
Bilb Jun 25, 2024
dadf6cf
chore: wip
Bilb Jun 26, 2024
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
Prev Previous commit
Next Next commit
feat: add sending and receiving of libsession encrypted msgs
still a wip though
  • Loading branch information
Bilb committed Sep 15, 2023
commit 08164f2fd00a319bbf75f7bafce33e676f0596e2
33 changes: 29 additions & 4 deletions ts/models/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import { from_hex } from 'libsodium-wrappers-sumo';
import { SignalService } from '../protobuf';
import { getMessageQueue } from '../session';
import { getConversationController } from '../session/conversations';
import { ClosedGroupVisibleMessage } from '../session/messages/outgoing/visibleMessage/ClosedGroupVisibleMessage';
import {
ClosedGroupV3VisibleMessage,
ClosedGroupVisibleMessage,
} from '../session/messages/outgoing/visibleMessage/ClosedGroupVisibleMessage';
import { PubKey } from '../session/types';
import { ToastUtils, UserUtils } from '../session/utils';
import { BlockedNumberController } from '../util';
Expand Down Expand Up @@ -221,7 +224,9 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
}

public isClosedGroupV3(): boolean {
return Boolean(this.get('type') === ConversationTypeEnum.GROUPV3 && this.id.startsWith('03'));
return Boolean(
this.get('type') === ConversationTypeEnum.GROUPV3 && PubKey.isClosedGroupV2(this.id)
);
}

public isPrivate() {
Expand Down Expand Up @@ -1701,6 +1706,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
// we are trying to send a message to someone. Make sure this convo is not hidden
await this.unhideIfNeeded(true);

// TODO break down those functions (sendMessage and retrySend into smaller functions and narrow the VisibleMessageParams to preview, etc. with checks of types)
// an OpenGroupV2 message is just a visible message
const chatMessageParams: VisibleMessageParams = {
body,
Expand Down Expand Up @@ -1761,8 +1767,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {

if (this.isPrivate()) {
if (this.isMe()) {
chatMessageParams.syncTarget = this.id;
const chatMessageMe = new VisibleMessage(chatMessageParams);
const chatMessageMe = new VisibleMessage({ ...chatMessageParams, syncTarget: this.id });

await getMessageQueue().sendSyncMessage({
namespace: SnodeNamespaces.Default,
Expand Down Expand Up @@ -1798,6 +1803,12 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
return;
}

if (this.isClosedGroupV3()) {
// we need the return await so that errors are caught in the catch {}
await this.sendMessageToGroupV3(chatMessageParams);
return;
}

if (this.isClosedGroup()) {
const chatMessageMediumGroup = new VisibleMessage(chatMessageParams);
const closedGroupVisibleMessage = new ClosedGroupVisibleMessage({
Expand All @@ -1819,6 +1830,20 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
}
}

private async sendMessageToGroupV3(chatMessageParams: VisibleMessageParams) {
const visibleMessage = new VisibleMessage(chatMessageParams);
const groupVisibleMessage = new ClosedGroupV3VisibleMessage({
chatMessage: visibleMessage,
destination: this.id,
namespace: SnodeNamespaces.ClosedGroupMessages,
});

// we need the return await so that errors are caught in the catch {}
await getMessageQueue().sendToGroupV3({
message: groupVisibleMessage,
});
}

private async sendBlindedMessageRequest(messageParams: VisibleMessageParams) {
const ourSignKeyBytes = await UserUtils.getUserED25519KeyPairBytes();
const groupUrl = this.getSogsOriginMessage();
Expand Down
6 changes: 3 additions & 3 deletions ts/receiver/closedGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export async function handleClosedGroupControlMessage(
}`
);

if (PubKey.isClosedGroupV3(envelope.source)) {
if (PubKey.isClosedGroupV2(envelope.source)) {
window?.log?.warn(
'Message ignored; closed group v3 updates cannot come from SignalService.DataMessage.ClosedGroupControlMessage '
);
Expand Down Expand Up @@ -168,7 +168,7 @@ function sanityCheckNewGroup(
return false;
}

if (PubKey.isClosedGroupV3(hexGroupPublicKey)) {
if (PubKey.isClosedGroupV2(hexGroupPublicKey)) {
window?.log?.warn('sanityCheckNewGroup: got a v3 new group as a ClosedGroupControlMessage. ');
return false;
}
Expand Down Expand Up @@ -520,7 +520,7 @@ async function performIfValid(
const groupPublicKey = envelope.source;
const sender = envelope.senderIdentity;

if (PubKey.isClosedGroupV3(groupPublicKey)) {
if (PubKey.isClosedGroupV2(groupPublicKey)) {
window?.log?.warn(
'Message ignored; closed group v3 updates cannot come from SignalService.DataMessage.ClosedGroupControlMessage '
);
Expand Down
24 changes: 22 additions & 2 deletions ts/receiver/contentMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ import { Storage } from '../util/storage';
import { handleCallMessage } from './callMessage';
import { getAllCachedECKeyPair, sentAtMoreRecentThanWrapper } from './closedGroups';
import { ECKeyPair } from './keypairs';
import { ContactsWrapperActions } from '../webworker/workers/browser/libsession_worker_interface';
import {
ContactsWrapperActions,
MetaGroupWrapperActions,
} from '../webworker/workers/browser/libsession_worker_interface';
import { PreConditionFailed } from '../session/utils/errors';

export async function handleSwarmContentMessage(envelope: EnvelopePlus, messageHash: string) {
try {
Expand All @@ -54,6 +58,18 @@ export async function handleSwarmContentMessage(envelope: EnvelopePlus, messageH
}
}

async function decryptForGroupV2(envelope: EnvelopePlus) {
window?.log?.info('received closed group message v2');
// try {
const groupPk = envelope.source;
if (!PubKey.isClosedGroupV2(groupPk)) {
throw new PreConditionFailed('decryptForGroupV2: not a 03 prefixed group');
}

return await MetaGroupWrapperActions.decryptMessage(groupPk, envelope.content);
// } catch (e) {}
}

async function decryptForClosedGroup(envelope: EnvelopePlus) {
// case .closedGroupCiphertext: for ios
window?.log?.info('received closed group message');
Expand Down Expand Up @@ -266,7 +282,11 @@ async function decrypt(envelope: EnvelopePlus): Promise<any> {
plaintext = await decryptEnvelopeWithOurKey(envelope);
break;
case SignalService.Envelope.Type.CLOSED_GROUP_MESSAGE:
plaintext = await decryptForClosedGroup(envelope);
if (PubKey.isClosedGroupV2(envelope.source)) {
plaintext = await decryptForGroupV2(envelope);
} else {
plaintext = await decryptForClosedGroup(envelope);
}
break;
default:
assertUnreachable(envelope.type, `Unknown message type:${envelope.type}`);
Expand Down
2 changes: 1 addition & 1 deletion ts/receiver/dataMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export async function handleSwarmDataMessage(
);

const isGroupMessage = !!envelope.senderIdentity;
const isGroupV3Message = isGroupMessage && PubKey.isClosedGroupV3(envelope.source);
const isGroupV3Message = isGroupMessage && PubKey.isClosedGroupV2(envelope.source);
let typeOfConvo = ConversationTypeEnum.PRIVATE;
if (isGroupV3Message) {
typeOfConvo = ConversationTypeEnum.GROUPV3;
Expand Down
8 changes: 7 additions & 1 deletion ts/session/apis/snode_api/batchRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import { processOnionRequestErrorAtDestination, SnodeResponse } from './onions';
import { snodeRpc } from './sessionRpc';
import { NotEmptyArrayOfBatchResults, SnodeApiSubRequests } from './SnodeRequestTypes';

function logSubRequests(requests: Array<SnodeApiSubRequests>) {
return requests.map(m =>
m.method === 'retrieve' || m.method === 'store' ? `${m.method}-${m.params.namespace}` : m.method
);
}

/**
* This is the equivalent to the batch send on sogs. The target node runs each sub request and returns a list of all the sub status and bodies.
* If the global status code is not 200, an exception is thrown.
Expand All @@ -23,7 +29,7 @@ export async function doSnodeBatchRequest(
): Promise<NotEmptyArrayOfBatchResults> {
console.warn(
`doSnodeBatchRequest "${method}":`,
JSON.stringify(subRequests.map(m => m.method))
JSON.stringify(logSubRequests(subRequests))
// subRequests
);
const result = await snodeRpc({
Expand Down
4 changes: 2 additions & 2 deletions ts/session/apis/snode_api/retrieveRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async function retrieveRequestForGroup({
namespace: SnodeNamespaces;
retrieveParam: RetrieveParams;
}) {
if (!PubKey.isClosedGroupV3(groupPk)) {
if (!PubKey.isClosedGroupV2(groupPk)) {
throw new Error('retrieveRequestForGroup: not a 03 group');
}
if (!SnodeNamespace.isGroupNamespace(namespace)) {
Expand Down Expand Up @@ -147,7 +147,7 @@ async function buildRetrieveRequest(
return retrieveRequestForLegacyGroup({ namespace, ourPubkey, pubkey, retrieveParam });
}

if (PubKey.isClosedGroupV3(pubkey)) {
if (PubKey.isClosedGroupV2(pubkey)) {
if (!SnodeNamespace.isGroupNamespace(namespace)) {
// either config or messages namespaces for 03 groups
throw new Error(`tried to poll from a non 03 group namespace ${namespace}`);
Expand Down
2 changes: 1 addition & 1 deletion ts/session/apis/snode_api/snodeSignatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function isSigParamsForGroupAdmin(
sigParams: SnodeSigParamsAdminGroup | SnodeSigParamsUs
): sigParams is SnodeSigParamsAdminGroup {
const asGr = sigParams as SnodeSigParamsAdminGroup;
return PubKey.isClosedGroupV3(asGr.groupPk) && !!asGr.privKey;
return PubKey.isClosedGroupV2(asGr.groupPk) && !!asGr.privKey;
}

async function getSnodeShared(params: SnodeSigParamsAdminGroup | SnodeSigParamsUs) {
Expand Down
4 changes: 2 additions & 2 deletions ts/session/apis/snode_api/swarmPolling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class SwarmPolling {
window?.log?.debug(
`Polling for ${loggingId}; timeout: ${convoPollingTimeout}; diff: ${diff} `
);
if (PubKey.isClosedGroupV3(key)) {
if (PubKey.isClosedGroupV2(key)) {
return this.pollOnceForKey([key, ConversationTypeEnum.GROUPV3]);
}
return this.pollOnceForKey([key, ConversationTypeEnum.GROUP]);
Expand Down Expand Up @@ -263,7 +263,7 @@ export class SwarmPolling {
} else if (
type === ConversationTypeEnum.GROUPV3 &&
confMessages?.length &&
PubKey.isClosedGroupV3(pubkey)
PubKey.isClosedGroupV2(pubkey)
) {
await SwarmPollingGroupConfig.handleGroupSharedConfigMessages(confMessages, pubkey);
}
Expand Down
4 changes: 2 additions & 2 deletions ts/session/conversations/ConversationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class ConversationController {
throw new TypeError(`'type' must be 'private' or 'group' or 'groupv3' but got: '${type}'`);
}

if (type === ConversationTypeEnum.GROUPV3 && !PubKey.isClosedGroupV3(id)) {
if (type === ConversationTypeEnum.GROUPV3 && !PubKey.isClosedGroupV2(id)) {
throw new Error(
'required v3 closed group` ` but the pubkey does not match the 03 prefix for them'
);
Expand Down Expand Up @@ -226,7 +226,7 @@ export class ConversationController {
// if we were kicked or sent our left message, we have nothing to do more with that group.
// Just delete everything related to it, not trying to add update message or send a left message.
await this.removeGroupOrCommunityFromDBAndRedux(groupId);
if (PubKey.isClosedGroupV3(groupId)) {
if (PubKey.isClosedGroupV2(groupId)) {
await remove03GroupFromWrappers(groupId);
} else {
await removeLegacyGroupFromWrappers(groupId);
Expand Down
Loading