UNPKG

tjc-sdk

Version:

TIANJI IM SDK

2 lines (1 loc) 858 B
import t from"../../client/tjc.js";import{MessageContentType as s}from"../messageContentType.js";import e from"./groupNotification.js";class i extends e{operator="";kickedMembers=[];constructor(t,e){super(s.KickOffGroupMember_Notification),this.operator=t,this.kickedMembers=e}formatNotification(){let s;s=this.fromSelf?"您把 ":t.getGroupMemberDisplayName(this.groupId,this.operator)+"把 ";let e="";return t.getUserInfos(this.kickedMembers,this.groupId).forEach((s=>{s.uid===t.getUserId()?e+=" 您":e+=" "+s.displayName})),s+e+" 移除了群组"}encode(){let s=super.encode(),e={g:this.groupId,ms:this.kickedMembers,o:this.operateUser};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.operator=i.o,this.kickedMembers=i.ms}}export{i as default};