本文整理汇总了C#中WhatsAppApi.Parser.FMessage.Offline方法的典型用法代码示例。如果您正苦于以下问题:C# FMessage.Offline方法的具体用法?C# FMessage.Offline怎么用?C# FMessage.Offline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhatsAppApi.Parser.FMessage
的用法示例。
在下文中一共展示了FMessage.Offline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TypeChat
//.........这里部分代码省略.........
}
else if (!double.TryParse(tmpAttrLatitude, WhatsConstants.WhatsAppNumberStyle, CultureInfo.InvariantCulture, out tmpLatitude) ||
!double.TryParse(tmpAttrLongitude, WhatsConstants.WhatsAppNumberStyle, CultureInfo.InvariantCulture, out tmpLongitude))
{
throw new CorruptStreamException("location message exception parsing lat or long attribute: " + tmpAttrLatitude + " " + tmpAttrLongitude);
}
builder.Latitude(tmpLatitude).Longitude(tmpLongitude);
string tmpAttrName = itemNode.GetAttribute("name");
string tmpAttrUrl = itemNode.GetAttribute("url");
if (tmpAttrName != null)
{
builder.Location_details(tmpAttrName);
}
if (tmpAttrUrl != null)
{
builder.Location_url(tmpAttrUrl);
}
}
if (builder.Media_wa_type().HasValue && (builder.Media_wa_type().Value) == FMessage.Type.Contact)
{
ProtocolTreeNode tmpChildMedia = itemNode.GetChild("media");
if (tmpChildMedia != null)
{
builder.Media_name(tmpChildMedia.GetAttribute("name")).Data(WhatsApp.SYSEncoding.GetString(tmpChildMedia.GetData()));
}
}
else
{
string tmpAttrEncoding = itemNode.GetAttribute("encoding") ?? "text";
if (tmpAttrEncoding == "text")
{
builder.Data(WhatsApp.SYSEncoding.GetString(itemNode.GetData()));
}
}
var tmpMessageKey = new FMessage.Key(tmpAttrFrom, false, tmpAttrbId);
builder.Key(tmpMessageKey).Remote_resource(tmpAttrFromJid).NewIncomingInstance();
}
else if (ProtocolTreeNode.TagEquals(itemNode, "request"))
{
builder.Wants_receipt(true);
}
else if (ProtocolTreeNode.TagEquals(itemNode, "x"))
{
string str16 = itemNode.GetAttribute("xmlns");
if ("jabber:x:event".Equals(str16) && (tmpAttrbId != null))
{
var tmpMessageKey = new FMessage.Key(tmpAttrFrom, true, tmpAttrbId);
}
}
else if (ProtocolTreeNode.TagEquals(itemNode, "received"))
{
if (tmpAttrbId != null)
{
var tmpMessageKey = new FMessage.Key(tmpAttrFrom, true, tmpAttrbId);
if (true)
{
string tmpAttrType = itemNode.GetAttribute("type");
if ((tmpAttrType != null) && !tmpAttrType.Equals("delivered"))
{
if (tmpAttrType.Equals("visible"))
{
this.sendHandler.SendVisibleReceiptAck(tmpAttrFrom, tmpAttrbId);
}
}
else
{
this.sendHandler.SendDeliveredReceiptAck(tmpAttrFrom, tmpAttrbId);
}
}
}
}
else if (ProtocolTreeNode.TagEquals(itemNode, "offline"))
{
builder.Offline(true);
}
else if (ProtocolTreeNode.TagEquals(itemNode, "notify"))
{
var tmpAttrName = itemNode.GetAttribute("name");
if (tmpAttrName != null)
{
builder.from_me = false;
builder.id = tmpAttrbId;
builder.remote_jid = tmpAttrFromJid;
builder.Key().serverNickname = tmpAttrName;
}
}
}
if (!builder.Timestamp().HasValue)
{
builder.Timestamp(new DateTime?(DateTime.Now));
}
FMessage message = builder.Build();
if (message != null)
{
WhatsEventHandler.OnMessageRecievedEventHandler(message);
}
}