func createMessageNode(to string, veriFiledName uint64, msgType string, c protocol.CiphertextMessage, participants *newxxmp.Node, phash ...string) *MessageNode {
var encType string
//return &MessageNode{BaseNode:NewBaseNode()}
encType = protocol.GetEncTypeString(c.Type())
// 暂时随机
id := strings.ToUpper(strings.ReplaceAll(guuid.New().String(), "-", ""))
// default promise 超时100秒
p := &MessageNode{id: id, BaseNode: NewBaseNode()}
// message node
messageNode := newxxmp.EmptyNode(NodeMessage)
messageNode.Attributes.AddAttr("to", to)
messageNode.Attributes.AddAttr("type", msgType)
messageNode.Attributes.AddAttr("id", id)
if veriFiledName != 0 {
//商业版本
messageNode.Attributes.AddAttr("verified_name", strconv.FormatUint(veriFiledName, 10))
whatsapp‘接口分析:創建消息代碼
最新推荐文章于 2024-01-03 15:40:03 发布