private string FormatText(string text, bool chat)
{
string result = string.Empty;
if (chat)
{
// Replace {name} with current chat room name.
result = Global.ReplaceString(text, "{name}", Global.Steam.Chat.GetChatName());
}
else
{
// Replace {name} with selected friend's name.
result = Global.ReplaceString(text, "{name}", p_FriendsList.SelectedItem.Text);
}
return result;
}