Exemplo n.º 1
0
        public string GetDisplayName(int version, bool forceOriginal = false)
        {
            StringBuilder sb = new StringBuilder();

            if (version < 2 && IsAway)
            {
                sb.AppendFormat(@"&lt;{0}&gt;_", AwayMessage.Substring(0, Math.Min(AwayMessage.Length, 5)).ToUpperInvariant());
            }

            if (forceOriginal || string.IsNullOrWhiteSpace(Nickname))
            {
                sb.Append(Username);
            }
            else
            {
                if (version < 2)
                {
                    sb.Append('~');
                }

                sb.Append(Nickname);
            }

            return(sb.ToString());
        }