Пример #1
0
        /// <summary>
        /// Construct a SignalServiceDataMessage
        /// </summary>
        /// <param name="timestamp">The sent timestamp.</param>
        /// <param name="group">The group information.</param>
        /// <param name="attachments">The attachments.</param>
        /// <param name="body">The message contents.</param>
        /// <param name="endSession">Flag indicating whether this message should close a session.</param>
        /// <param name="expiresInSeconds">The number of seconds in which a message should disappear after having been seen.</param>
        public SignalServiceDataMessage(long timestamp,
                                        SignalServiceGroup group,
                                        List <SignalServiceAttachment> attachments,
                                        string body,
                                        bool endSession,
                                        int expiresInSeconds,
                                        bool expirationUpdate)
        {
            this.timestamp        = timestamp;
            this.body             = new May <string>(body);
            this.group            = group == null ? May <SignalServiceGroup> .NoValue : new May <SignalServiceGroup>(group);
            this.endSession       = endSession;
            this.expiresInSeconds = expiresInSeconds;
            this.expirationUpdate = expirationUpdate;

            if (attachments != null && !(attachments.Count == 0))
            {
                this.attachments = new May <List <SignalServiceAttachment> >(attachments);
            }
            else
            {
                this.attachments = May <List <SignalServiceAttachment> > .NoValue;
            }
        }
Пример #2
0
 /// <summary>
 /// Construct a SignalServiceDataMessage group message with attachments and body.
 /// </summary>
 /// <param name="timestamp">The sent timestamp.</param>
 /// <param name="group">The group information.</param>
 /// <param name="attachments">The attachments.</param>
 /// <param name="body">The message contents.</param>
 public SignalServiceDataMessage(long timestamp, SignalServiceGroup group, List <SignalServiceAttachment> attachments, string body)
     : this(timestamp, group, attachments, body, 0)
 {
 }
Пример #3
0
 public Builder asGroupMessage(SignalServiceGroup group)
 {
     this.group = group;
     return(this);
 }
Пример #4
0
 /// <summary>
 /// Construct an expiring SignalServiceDataMessage group message with attachments and body.
 /// </summary>
 /// <param name="timestamp">The sent timestamp.</param>
 /// <param name="group">The group information.</param>
 /// <param name="attachments">The attachments.</param>
 /// <param name="body">The message contents.</param>
 /// <param name="expiresInSeconds">The number of seconds in which a message should disappear after having been seen.</param>
 public SignalServiceDataMessage(long timestamp, SignalServiceGroup group, List <SignalServiceAttachment> attachments, string body, int expiresInSeconds)
     : this(timestamp, group, attachments, body, false, expiresInSeconds, false)
 {
 }