Skip to content

Commit ac93459

Browse files
committed
feat: wrap group description get/set in infos
1 parent f9db679 commit ac93459

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/groups/meta_group_wrapper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ Napi::Value MetaGroupWrapper::infoGet(const Napi::CallbackInfo& info) {
389389

390390
obj["isDestroyed"] = toJs(env, this->meta_group->info->is_destroyed());
391391
obj["profilePicture"] = toJs(env, this->meta_group->info->get_profile_pic());
392+
obj["description"] = toJs(env, this->meta_group->info->get_description().value_or(""));
392393

393394
return obj;
394395
});
@@ -427,6 +428,11 @@ Napi::Value MetaGroupWrapper::infoSet(const Napi::CallbackInfo& info) {
427428
this->meta_group->info->set_profile_pic(profilePic);
428429
}
429430

431+
if (auto description = maybeNonemptyString(
432+
obj.Get("description"), "MetaGroupWrapper::setInfo description")) {
433+
this->meta_group->info->set_description_truncated(*description);
434+
}
435+
430436
return this->infoGet(info);
431437
});
432438
}

types/shared.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ declare module 'libsession_util_nodejs' {
122122
deleteBeforeSeconds: number | null;
123123
expirySeconds: number | null;
124124
profilePicture: ProfilePicture | null;
125+
/**
126+
* The group description. Defaults to "" if unset
127+
*/
128+
description: string;
125129
};
126130

127131
export type GroupInfoGet = GroupInfoShared & {

0 commit comments

Comments
 (0)