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
2 changes: 1 addition & 1 deletion libsession-util
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"main": "index.js",
"name": "libsession_util_nodejs",
"description": "Wrappers for the Session Util Library",
"version": "0.4.9",
"version": "0.4.10",
"license": "GPL-3.0",
"author": {
"name": "Oxen Project",
Expand Down
15 changes: 15 additions & 0 deletions src/groups/meta_group_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ void MetaGroupWrapper::Init(Napi::Env env, Napi::Object exports) {
InstanceMethod(
"memberSetNameTruncated", &MetaGroupWrapper::memberSetNameTruncated),
InstanceMethod("memberSetInviteSent", &MetaGroupWrapper::memberSetInviteSent),
InstanceMethod("memberSetInviteNotSent", &MetaGroupWrapper::memberSetInviteNotSent),
InstanceMethod(
"memberSetInviteFailed", &MetaGroupWrapper::memberSetInviteFailed),
InstanceMethod(
Expand Down Expand Up @@ -553,6 +554,20 @@ void MetaGroupWrapper::memberSetInviteSent(const Napi::CallbackInfo& info) {
});
}


void MetaGroupWrapper::memberSetInviteNotSent(const Napi::CallbackInfo& info) {
wrapExceptions(info, [&] {
assertIsString(info[0]);
auto pubkeyHex = toCppString(info[0], "memberSetInviteNotSent");

auto m = this->meta_group->members->get(pubkeyHex);
if (m) {
m->set_invite_not_sent();
this->meta_group->members->set(*m);
}
});
}

void MetaGroupWrapper::memberSetInviteAccepted(const Napi::CallbackInfo& info) {
wrapExceptions(info, [&] {
assertInfoLength(info, 1);
Expand Down
1 change: 1 addition & 0 deletions src/groups/meta_group_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class MetaGroupWrapper : public Napi::ObjectWrap<MetaGroupWrapper> {
void memberSetNameTruncated(const Napi::CallbackInfo& info);
void memberSetInviteFailed(const Napi::CallbackInfo& info);
void memberSetInviteSent(const Napi::CallbackInfo& info);
void memberSetInviteNotSent(const Napi::CallbackInfo& info);
void memberSetInviteAccepted(const Napi::CallbackInfo& info);
void memberSetPromoted(const Napi::CallbackInfo& info);
void memberSetPromotionSent(const Napi::CallbackInfo& info);
Expand Down
6 changes: 6 additions & 0 deletions types/groups/groupmembers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ declare module 'libsession_util_nodejs' {
* Use this function to mark that you've sent one successfully.
**/
memberSetInviteSent: (pubkeyHex: PubkeyType) => void;

/**
* Reset a member's invite state to not_sent. This will mark it as "sending" on the current device
* and "not sent" on any others.
*/
memberSetInviteNotSent: (pubkeyHex: PubkeyType) => void;
/** User has accepted an invitation and is now a regular member of the group */
memberSetInviteAccepted: (pubkeyHex: PubkeyType) => void;

Expand Down
2 changes: 2 additions & 0 deletions types/groups/metagroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ declare module 'libsession_util_nodejs' {
public memberSetPromotionSent: MetaGroupWrapper['memberSetPromotionSent'];
public memberSetPromotionFailed: MetaGroupWrapper['memberSetPromotionFailed'];
public memberSetInviteSent: MetaGroupWrapper['memberSetInviteSent'];
public memberSetInviteNotSent: MetaGroupWrapper['memberSetInviteNotSent'];
public memberSetInviteFailed: MetaGroupWrapper['memberSetInviteFailed'];
public memberEraseAndRekey: MetaGroupWrapper['memberEraseAndRekey'];
public membersMarkPendingRemoval: MetaGroupWrapper['membersMarkPendingRemoval'];
Expand Down Expand Up @@ -147,6 +148,7 @@ declare module 'libsession_util_nodejs' {
| MakeActionCall<MetaGroupWrapper, 'memberSetPromotionSent'>
| MakeActionCall<MetaGroupWrapper, 'memberSetPromotionAccepted'>
| MakeActionCall<MetaGroupWrapper, 'memberSetInviteSent'>
| MakeActionCall<MetaGroupWrapper, 'memberSetInviteNotSent'>
| MakeActionCall<MetaGroupWrapper, 'memberSetInviteFailed'>
| MakeActionCall<MetaGroupWrapper, 'memberEraseAndRekey'>
| MakeActionCall<MetaGroupWrapper, 'membersMarkPendingRemoval'>
Expand Down
Loading