private void ConnectUserStreams()
{
// All tweets to the HomeTimeLine
UserStream.Tweets.Subscribe(AddToHomeTimeLine);
// MAGIC HAPPENS HERE
// there is no specific "catch" for mentions in the Userstream, but here we can fake it!
// Using LINQ, we can ask RX to show us incoming tweets that contain the screen name of the current user
// then push this into the "Mentions" Observable
UserStream.Tweets.Where(t => t.Text.ToLower().Contains(TwitterCredentials.ScreenName.ToLower())).Subscribe(_mentions.OnNext);
// specifically grab the Retweets in the timeline and show them
// obviously this can be added at a higher level, too.
UserStream.Tweets.Where(t => t.RetweetedStatus != null).Subscribe(_retweetsOnTimeline.OnNext);
// Treat Direct Messages separately
UserStream.DirectMessages.Subscribe(_directmessages.OnNext);
// Pull out my tweets, and publish separately
UserStream.Tweets.Where(t => t.User.UserId == TwitterCredentials.UserID).Subscribe(_mytweets.OnNext);
// also grab the delete events and publish
UserStream.DeleteEvents.Subscribe(de => _streamdeleteevent.OnNext(de.DeleteEventStatus));
UserStream.Start();
_userStreamConnected.OnNext(StreamSignal.Started);
}
#region FAIL-OVER TO PULL REQUESTS