UNPKG

tjc-sdk

Version:

TIANJI IM SDK

2 lines (1 loc) 942 B
import t from"./groupNotification.js";import{MessageContentType as s}from"../messageContentType.js";import e from"../../client/tjc.js";class i extends t{operator;setManagerType;memberIds=[];constructor(t,e,i){super(s.SetGroupManager_Notification),this.operator=t,this.setManagerType=e,this.memberIds=i}formatNotification(t){let s=this.fromSelf?"您":e.getGroupMemberDisplayName(this.groupId,this.operator);return s+="把 ",this.memberIds.forEach((t=>{s+=" ",s+=e.getGroupMemberDisplayName(this.groupId,t)})),s+=" ",s+=0===this.setManagerType?"取消了管理员":"设置为了管理员",s}encode(){let t=super.encode(),s={g:this.groupId,o:this.operator,n:this.setManagerType+"",ms:this.memberIds};return t.binaryContent=e.utf8_to_b64(JSON.stringify(s)),t}decode(t){super.decode(t);let s=JSON.parse(e.b64_to_utf8(t.binaryContent));this.groupId=s.g,this.operator=s.o,this.setManagerType=parseInt(s.n),this.memberIds=s.ms}}export{i as default};