diff --git a/node/lib/chat.ts b/node/lib/chat.ts index 18ec2eb26..49a6b8f52 100644 --- a/node/lib/chat.ts +++ b/node/lib/chat.ts @@ -39,6 +39,10 @@ export class Chat { return binding.dcn_chat_get_name(this.dc_chat) } + getMailinglistAddr(): string { + return binding.dcn_chat_get_mailinglist_addr(this.dc_chat) + } + getProfileImage(): string { return binding.dcn_chat_get_profile_image(this.dc_chat) } @@ -92,6 +96,7 @@ export class Chat { color: this.color, id: this.getId(), name: this.getName(), + mailinglistAddr: this.getMailinglistAddr(), profileImage: this.getProfileImage(), type: this.getType(), isSelfTalk: this.isSelfTalk(), diff --git a/node/lib/types.ts b/node/lib/types.ts index feb6e981e..6bb54d9f8 100644 --- a/node/lib/types.ts +++ b/node/lib/types.ts @@ -12,6 +12,7 @@ export interface ChatJSON { color: string id: number name: string + mailinglistAddr: string profileImage: string type: number isSelfTalk: boolean diff --git a/node/src/module.c b/node/src/module.c index b0804d90d..2444ff28d 100644 --- a/node/src/module.c +++ b/node/src/module.c @@ -1625,6 +1625,18 @@ NAPI_METHOD(dcn_chat_get_name) { NAPI_RETURN_AND_UNREF_STRING(name); } +NAPI_METHOD(dcn_chat_get_mailinglist_addr) { + NAPI_ARGV(1); + NAPI_DC_CHAT(); + + //TRACE("calling.."); + char* addr = dc_chat_get_mailinglist_addr(dc_chat); + //TRACE("result %s", name); + + NAPI_RETURN_AND_UNREF_STRING(addr); +} + + NAPI_METHOD(dcn_chat_get_profile_image) { NAPI_ARGV(1); NAPI_DC_CHAT(); @@ -3370,6 +3382,7 @@ NAPI_INIT() { NAPI_EXPORT_FUNCTION(dcn_chat_get_visibility); NAPI_EXPORT_FUNCTION(dcn_chat_get_id); NAPI_EXPORT_FUNCTION(dcn_chat_get_name); + NAPI_EXPORT_FUNCTION(dcn_chat_get_mailinglist_addr); NAPI_EXPORT_FUNCTION(dcn_chat_get_profile_image); NAPI_EXPORT_FUNCTION(dcn_chat_get_type); NAPI_EXPORT_FUNCTION(dcn_chat_is_self_talk);