Return proto wrapper instead of proto class
This commit is contained in:
parent
5cbc4b90fb
commit
e25f3c0b44
|
@ -1,12 +1,13 @@
|
||||||
import { Reader } from "protobufjs";
|
import { Reader } from "protobufjs";
|
||||||
|
|
||||||
import { ChatIdentity } from "../proto/communities/v1/chat_identity";
|
|
||||||
import * as proto from "../proto/communities/v1/communities";
|
import * as proto from "../proto/communities/v1/communities";
|
||||||
import {
|
import {
|
||||||
CommunityMember,
|
CommunityMember,
|
||||||
CommunityPermissions,
|
CommunityPermissions,
|
||||||
} from "../proto/communities/v1/communities";
|
} from "../proto/communities/v1/communities";
|
||||||
|
|
||||||
|
import { ChatIdentity } from "./chat_identity";
|
||||||
|
|
||||||
export class CommunityChat {
|
export class CommunityChat {
|
||||||
public constructor(public proto: proto.CommunityChat) {}
|
public constructor(public proto: proto.CommunityChat) {}
|
||||||
|
|
||||||
|
@ -41,7 +42,9 @@ export class CommunityChat {
|
||||||
}
|
}
|
||||||
|
|
||||||
public get identity(): ChatIdentity | undefined {
|
public get identity(): ChatIdentity | undefined {
|
||||||
return this.proto.identity;
|
if (!this.proto.identity) return;
|
||||||
|
|
||||||
|
return new ChatIdentity(this.proto.identity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Document this
|
// TODO: Document this
|
||||||
|
|
Loading…
Reference in New Issue