-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create user group for old users
- Loading branch information
1 parent
e1f3a17
commit ee1423d
Showing
4 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { queryUserGroupDatabase } from '../group' | ||
import { getMyIdentitiesDB } from '../people' | ||
import { GroupIdentifier } from '../type' | ||
import { createDefaultFriendsGroup } from '../helpers/group' | ||
|
||
/** | ||
* If an identity has no default user group, create one | ||
*/ | ||
export default async function createUserGroupForOldUsers() { | ||
const ids = await getMyIdentitiesDB() | ||
for (const id of ids) { | ||
const g = await queryUserGroupDatabase(GroupIdentifier.getDefaultFriendsGroupIdentifier(id.identifier)) | ||
if (!g) createDefaultFriendsGroup(id.identifier) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import avatar from './old.avatar.1' | ||
import localKeys from './old.localKeys.1' | ||
import keys from './old.keystore.1' | ||
import createUserGroupForOldUsers from './create.user.group.for.old.users' | ||
|
||
createUserGroupForOldUsers() | ||
avatar() | ||
.finally(() => localKeys()) | ||
.finally(() => keys()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters