tjc-sdk
Version:
TIANJI IM SDK
2 lines (1 loc) • 702 B
JavaScript
import t from"../../client/tjc.js";import{MessageContentType as s}from"../messageContentType.js";import e from"./groupNotification.js";class i extends e{creator="";groupName="";constructor(t,e){super(s.CreateGroup_Notification),this.creator=t,this.groupName=e}formatNotification(){return this.fromSelf?"您创建了群组 "+this.groupName:t.getUserDisplayName(this.creator)+"创建了群组 "+this.groupName}encode(){let s=super.encode(),e={g:this.groupId,n:this.groupName,o:this.creator};return s.binaryContent=t.utf8_to_b64(JSON.stringify(e)),s}decode(s){super.decode(s);let e=t.b64_to_utf8(s.binaryContent),i=JSON.parse(e);this.groupId=i.g,this.creator=i.o,this.groupName=i.n}}export{i as default};