Example #1
0
        /// <summary>
        /// Get the Original message.
        /// </summary>
        public PrivateMessage GetParent()
        {
            if (this.thread == null)
            {
                this.thread = GetThread();
                if (this.thread == null)
                {
                    return(null);
                }
            }
            //TODO: Convert this into an async function
            var firstPage = thread.FirstAsync().AsTask();

            firstPage.Wait();
            var firstMessage = firstPage.Result;

            if (firstMessage?.FullName == ParentID)
            {
                return(firstMessage);
            }
            else
            {
                return(firstMessage.Replies.First(x => x.FullName == ParentID));
            }
        }