UNPKG

tjc-sdk

Version:

TIANJI IM SDK

2 lines (1 loc) 818 B
import t from"../../client/tjc.js";import{MessageContentType as s}from"../messageContentType.js";import i from"./groupNotification.js";class e extends i{operator="";newOwner="";constructor(t,i){super(s.TransferGroupOwner_Notification),this.operator=t,this.newOwner=i}formatNotification(){return this.fromSelf?"您把群转让给了 "+t.getGroupMemberDisplayName(this.groupId,this.newOwner):t.getGroupMemberDisplayName(this.groupId,this.operator)+"把群转让给了 "+t.getGroupMemberDisplayName(this.groupId,this.newOwner)}encode(){let s=super.encode(),i={g:this.groupId,o:this.operator,m:this.newOwner};return s.binaryContent=t.utf8_to_b64(JSON.stringify(i)),s}decode(s){super.decode(s);let i=t.b64_to_utf8(s.binaryContent),e=JSON.parse(i);this.groupId=e.g,this.operator=e.o,this.newOwner=e.m}}export{e as default};