/// <summary>
        /// Strip HTML tags from MessageActionsPayloadBody content.
        /// </summary>
        /// <param name="body">The MessageActionsPayloadBody.</param>
        /// <returns>Plain text content.</returns>
        public static string GetPlainTextContent(this MessageActionsPayloadBody body)
        {
            var doc = new HtmlDocument();

            doc.LoadHtml(body.content);
            return(StripHtmlTags(doc.DocumentNode, textRestrictedHtmlTags));
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the MessageActionsPayload class.
 /// </summary>
 /// <param name="id">Unique id of the message.</param>
 /// <param name="replyToId">Id of the parent/root message of the
 /// thread.</param>
 /// <param name="messageType">Type of message - automatically set to
 /// message. Possible values include: 'message'</param>
 /// <param name="createdDateTime">Timestamp of when the message was
 /// created.</param>
 /// <param name="lastModifiedDateTime">Timestamp of when the message
 /// was edited or updated.</param>
 /// <param name="deleted">Indicates whether a message has been soft
 /// deleted.</param>
 /// <param name="subject">Subject line of the message.</param>
 /// <param name="summary">Summary text of the message that could be
 /// used for notifications.</param>
 /// <param name="importance">The importance of the message. Possible
 /// values include: 'normal', 'high', 'urgent'</param>
 /// <param name="locale">Locale of the message set by the
 /// client.</param>
 /// <param name="from">Sender of the message.</param>
 /// <param name="body">Plaintext/HTML representation of the content of
 /// the message.</param>
 /// <param name="attachmentLayout">How the attachment(s) are displayed
 /// in the message.</param>
 /// <param name="attachments">Attachments in the message - card, image,
 /// file, etc.</param>
 /// <param name="mentions">List of entities mentioned in the
 /// message.</param>
 /// <param name="reactions">Reactions for the message.</param>
 public MessageActionsPayload(string id = default(string), string replyToId = default(string), string messageType = default(string), string createdDateTime = default(string), string lastModifiedDateTime = default(string), bool?deleted = default(bool?), string subject = default(string), string summary = default(string), string importance = default(string), string locale = default(string), MessageActionsPayloadFrom from = default(MessageActionsPayloadFrom), MessageActionsPayloadBody body = default(MessageActionsPayloadBody), string attachmentLayout = default(string), IList <MessageActionsPayloadAttachment> attachments = default(IList <MessageActionsPayloadAttachment>), IList <MessageActionsPayloadMention> mentions = default(IList <MessageActionsPayloadMention>), IList <MessageActionsPayloadReaction> reactions = default(IList <MessageActionsPayloadReaction>))
 {
     Id                   = id;
     ReplyToId            = replyToId;
     MessageType          = messageType;
     CreatedDateTime      = createdDateTime;
     LastModifiedDateTime = lastModifiedDateTime;
     Deleted              = deleted;
     Subject              = subject;
     Summary              = summary;
     Importance           = importance;
     Locale               = locale;
     From                 = from;
     Body                 = body;
     AttachmentLayout     = attachmentLayout;
     Attachments          = attachments;
     Mentions             = mentions;
     Reactions            = reactions;
     CustomInit();
 }