Skip to content

Commit

Permalink
Don't prepend group name if announcement title already contains it
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Jun 20, 2014
1 parent 1184bd3 commit e0a8c00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ public static void OnClanState(SteamFriends.ClanStateCallback callback)

foreach (var announcement in callback.Announcements)
{
var message = string.IsNullOrEmpty(groupName) ? announcement.Headline : string.Format("{0}:\n{1}", groupName, announcement.Headline);
var message = announcement.Headline;

if (!string.IsNullOrEmpty(groupName) && !announcement.Headline.Contains(groupName))
{
message = string.Format("{0}:\n{1}", groupName, announcement.Headline);
}

PublishTweet(message, string.Format("http://steamcommunity.com/gid/{0}/announcements/detail/{1}", callback.ClanID, announcement.ID));
}
Expand Down

0 comments on commit e0a8c00

Please sign in to comment.