UNPKG

tjc-sdk

Version:

TIANJI IM SDK

2 lines (1 loc) 794 B
import e from"../../messages/messageContent.js";import{MessageContentType as s}from"../../messages/messageContentType.js";import t from"../../client/tjc.js";import{stringValue as i,_patchToJavaLong as r,_reverseToJsLongString as o,longValue as n}from"../../util/longUtil.js";class l extends e{callId;reason;inviteMsgUid;constructor(e=0,t=[]){super(s.VOIP_CONTENT_TYPE_END,e,t)}digest(){return""}encode(){let e=super.encode();e.content=this.callId;let s={r:this.reason,u:this.inviteMsgUid?i(this.inviteMsgUid):void 0},o=JSON.stringify(s);return o=r(o,"u"),e.binaryContent=t.utf8_to_b64(o),e.pushData=o,e}decode(e){super.decode(e),this.callId=e.content;let s=t.b64_to_utf8(e.binaryContent);s=o(s,"u");let i=JSON.parse(s);this.reason=i.r,this.inviteMsgUid=i.u?n(i.u):void 0}}export{l as default};