o3o can now have multiple users! Every user has their own tweetstack, which can send and receive tweets, DMs, mentions, etc. Events and such have to be hooked per user. Static retrieval of tweets is no longer supported, and everything will be done through streaming tweets.
예제 #1
0
파일: TweetStack.cs 프로젝트: zahndy/o3o
        public TweetStack(UserDatabase.User OAuth)
        {
            privOAuth = OAuth;
            Twitter = new TwitterInteraction(privOAuth);
            //and attempt to load the keys from setting
            //If that gone well, and streaming tweets were requested, try initialize streaming tweets.

            Twitterizer.Streaming.StreamOptions Streamopts = new Twitterizer.Streaming.StreamOptions();
            Streamopts.UseCompression = false;
            Streamopts.Count = 0;
            StartStream(Streamopts);
        }
예제 #2
0
        public DMElement(MainWindow1 prnt, TwitterDirectMessage status, UserDatabase.User usr, ImageSource Imagesource, bool MoreThanOneUser = false)
        {
            InitializeComponent();
            dbUser = usr;
            moreusers = MoreThanOneUser;
            name = status.Sender.ScreenName;
            tweetImg.Source = Imagesource;
            ID = status.Id.ToString();
            Status = status;

            parent = prnt;
            SolidColorBrush gBrush = new SolidColorBrush(Color.FromArgb((byte)(polyOpacity * 255), 0, 0, 0));
            messagePolygon.Fill = gBrush;
        }
예제 #3
0
 public TweetElement(dynamic prnt, TwitterStatus status, UserDatabase.User usr)
 {
     InitializeComponent();
     dbUser = usr;
     name = status.User.ScreenName;
     Date = status.CreatedDate.Month.ToString() + "/" + status.CreatedDate.Day.ToString() + " " + status.CreatedDate.Hour.ToString() + ":" + status.CreatedDate.Minute.ToString();
     imagelocation = status.User.ProfileImageLocation;
     ID = status.Id.ToString();
     Status = status;
     datelabel.Text = Date;
     parent = prnt;
     SolidColorBrush gBrush = new SolidColorBrush(Color.FromArgb((byte)(polyOpacity * 255), 0, 0, 0));
     messagePolygon.Fill = gBrush;
 }
예제 #4
0
 public DMElement(dynamic prnt, TwitterDirectMessage DM, UserDatabase.User usr)
 {
     InitializeComponent();
     dbUser = usr;
     Tweet = DM.Text;
     name = DM.Sender.ScreenName;
     Date = DM.CreatedDate.Month.ToString() + "/" + DM.CreatedDate.Day.ToString() + " " + DM.CreatedDate.Hour.ToString() + ":" + DM.CreatedDate.Minute.ToString();
     imagelocation = DM.Sender.ProfileImageLocation;
     ID = DM.Id.ToString();
     DirectMessage = DM;
     TweetBlock.Text = Tweet;
     datelabel.Text = Date;
     parent = prnt;
     SolidColorBrush gBrush = new SolidColorBrush(Color.FromArgb((byte)(polyOpacity*255),0,0,0));
     messagePolygon.Fill = gBrush;
 }
예제 #5
0
        public TweetElement(MainWindow1 prnt, TwitterStatus status, UserDatabase.User usr, ImageSource Imagesource, bool MoreThanOneUser = false)
        {
            InitializeComponent();
            dbUser = usr;
            moreusers = MoreThanOneUser;
            name = status.User.ScreenName;
            tweetImg.Source = Imagesource;
            ID = status.Id.ToString();
            Status = status;

            favBtn.MouseDown += new MouseButtonEventHandler(favBtn_MouseDown);

            if (status.Retweeted != true)
            {
                retweetBtn.MouseDown += new MouseButtonEventHandler(retweetBtn_MouseDown);
            }

            parent = prnt;
            SolidColorBrush gBrush = new SolidColorBrush(Color.FromArgb((byte)(polyOpacity * 255), 0, 0, 0));
            messagePolygon.Fill = gBrush;
        }
예제 #6
0
파일: App.xaml.cs 프로젝트: xarinatan/o3o
 public void FillMentions(TwitterStatus status, UserDatabase.User _usr)
 {
     TweetElement element = new TweetElement(Mainwindow, status, _usr);
     element.polyOpacity = polygonOpacity;
     Mainwindow.TweetMentions.Items.Insert(0, element);
     if (Mainwindow.TweetMentions.Items.Count > o3o.Properties.Settings.Default.amountOfTWeetsToDisplay)
     {
         //Mainwindow.TweetMentions.Items.RemoveAt(Mainwindow.TweetElements.Items.Count-1);
         TweetElement el = Mainwindow.TweetMentions.Items[Mainwindow.TweetElements.Items.Count - 1];
         Mainwindow.TweetMentions.Items.Remove(el);
         el.Dispose();
     }
 }
예제 #7
0
파일: TweetStack.cs 프로젝트: zahndy/o3o
 public TwitterInteraction(UserDatabase.User _oauth)
 {
     privOAuth = _oauth;
 }
예제 #8
0
 public UserAccounts(UserDatabase db)
 {
     UsrDB = db;
     InitializeComponent();
     RefreshList();
 }
예제 #9
0
파일: App.xaml.cs 프로젝트: xarinatan/o3o
 // PLZ CHECK IF WORK
 void o3o_NewDM(TwitterDirectMessage DM, UserDatabase.User _usr)
 {
     DMElement element = new DMElement(Mainwindow, DM, _usr);
     element.polyOpacity = polygonOpacity;
     Mainwindow.TweetMessages.Items.Add(element);
     if (Mainwindow.TweetMessages.Items.Count > o3o.Properties.Settings.Default.amountOfTWeetsToDisplay)
     {
         Mainwindow.TweetMessages.Items.RemoveAt(Mainwindow.TweetElements.Items.Count);
     }
 }
예제 #10
0
파일: App.xaml.cs 프로젝트: xarinatan/o3o
        void o3o_NewTweet(TwitterStatus status, UserDatabase.User _usr)
        {
            dostuffdel = new dostuff(FillHome);
            maindispatcher.Invoke(dostuffdel, new object[] { status, _usr});

            dostuffdel = new dostuff(Notification);
            maindispatcher.Invoke(dostuffdel, new object[] { status,_usr });
        }
예제 #11
0
파일: App.xaml.cs 프로젝트: xarinatan/o3o
        public void Notification(TwitterStatus status, UserDatabase.User _usr)
        {
            notify notification = new notify();
            TweetElement element = new TweetElement(Mainwindow, status, _usr);

            element.polyOpacity = polygonOpacity;
            element.replyBtn.Source = new BitmapImage(new Uri("/o3o;component/Images/reply.png", UriKind.Relative));
            notification.content.Items.Add(element);
            playsound();
        }
예제 #12
0
파일: App.xaml.cs 프로젝트: xarinatan/o3o
 public void UpdateUserMenu(UserDatabase usrDB)
 {
     Mainwindow.UserSelectionMenu.Items.Clear();
     foreach (UserDatabase.User usr in usrDB.Users)
     {
         System.Windows.Controls.MenuItem newMenuItem1 = new System.Windows.Controls.MenuItem(); // here you add more users to the menu, also the events when the user selects something
         newMenuItem1.Header = usr.UserDetails.ScreenName;
         newMenuItem1.Click += new RoutedEventHandler(newMenuItem1_Click);
         Mainwindow.UserSelectionMenu.Items.Add(newMenuItem1);
     }
 }
예제 #13
0
파일: App.xaml.cs 프로젝트: xarinatan/o3o
 public void FillHome(TwitterStatus status, UserDatabase.User _usr)
 {
     if (status.InReplyToScreenName == UsrDB.Users.Find(u => u.UserDetails.ScreenName == _usr.UserDetails.ScreenName).UserDetails.ScreenName)
     {
         FillMentions(status, _usr) ;
     }
     TweetElement element = new TweetElement(Mainwindow, status, _usr);
     element.polyOpacity = polygonOpacity;
     Mainwindow.TweetElements.Items.Insert(0, element);
     if (Mainwindow.TweetElements.Items.Count > o3o.Properties.Settings.Default.amountOfTWeetsToDisplay)
     {
        // Mainwindow.TweetElements.Items[Mainwindow.TweetElements.Items.Count - 1].Dispose();
         //Mainwindow.TweetElements.Items.RemoveAt(Mainwindow.TweetElements.Items.Count-1);
         TweetElement el = Mainwindow.TweetElements.Items[Mainwindow.TweetElements.Items.Count - 1];
         Mainwindow.TweetElements.Items.Remove(el);
         el.Dispose();
     }
 }
예제 #14
0
파일: UserAccounts.cs 프로젝트: zahndy/o3o
 public UserAccounts(UserDatabase db)
 {
     UsrDB = db;
     InitializeComponent();
     RefreshList();
 }
예제 #15
0
        private void prefetch(UserDatabase.User usr)
        {
            TwitterStatusCollection prefetch = usr.tweetStack.Twitter.GetTweets();
            foreach (TwitterStatus status in prefetch)
            {

                TweetElement element = new TweetElement(this, status, usr, ImageCache.GetImage(status.User.Id, status.User.ProfileImageLocation));
                element.polyOpacity = polygonOpacity;
                this.TweetElements.Items.Add(element);

                if (this.TweetElements.Items.Count > o3o.Properties.Settings.Default.amountOfTWeetsToDisplay)
                {
                    TweetElement el = (TweetElement)this.TweetElements.Items[this.TweetElements.Items.Count - 1];
                    this.TweetElements.Items.Remove(el);
                    el.Dispose();
                }
            }

            TwitterStatusCollection prefetchMentions = usr.tweetStack.Twitter.GetMentions();

            foreach (TwitterStatus status in prefetchMentions)
            {

                TweetElement element = new TweetElement(this, status, usr, ImageCache.GetImage(status.User.Id, status.User.ProfileImageLocation));
                element.polyOpacity = polygonOpacity;
                this.TweetMentions.Items.Add(element);

                if (this.TweetElements.Items.Count > o3o.Properties.Settings.Default.amountOfTWeetsToDisplay)
                {
                    TweetElement el = (TweetElement)this.TweetMentions.Items[this.TweetMentions.Items.Count - 1];
                    this.TweetMentions.Items.Remove(el);
                    el.Dispose();
                }
            }

            TwitterDirectMessageCollection fetchmessages = usr.tweetStack.Twitter.GetMessages();

            foreach (TwitterDirectMessage message in fetchmessages)
            {

                DMElement element = new DMElement(this, message, usr, ImageCache.GetImage(message.SenderId, message.Sender.ProfileImageLocation));
                element.polyOpacity = polygonOpacity;
                this.TweetMessages.Items.Add(element);

                if (this.TweetMessages.Items.Count > o3o.Properties.Settings.Default.amountOfTWeetsToDisplay)
                {
                    DMElement el = (DMElement)this.TweetMessages.Items[this.TweetMessages.Items.Count - 1];
                    this.TweetMessages.Items.Remove(el);
                    el.Dispose();
                }
            }
        }
예제 #16
0
 // PLZ CHECK IF WORK
 void o3o_NewDM(TwitterDirectMessage DM, UserDatabase.User _usr)
 {
     DMElement element;
     if (UsrDB.Users.Count > 1)
     {
          element = new DMElement(this, DM, _usr, ImageCache.GetImage(DM.Sender.Id, DM.Sender.ProfileImageLocation), true);
     }
     else
     {
          element = new DMElement(this, DM, _usr, ImageCache.GetImage(DM.Sender.Id, DM.Sender.ProfileImageLocation));
     }
     element.polyOpacity = polygonOpacity;
     this.TweetMessages.Items.Add(element);
     if (this.TweetMessages.Items.Count > o3o.Properties.Settings.Default.amountOfTWeetsToDisplay)
     {
         TweetElement el = (TweetElement)this.TweetMessages.Items[this.TweetMessages.Items.Count - 1];
         this.TweetMessages.Items.Remove(el);
         el.Dispose();
     }
 }
예제 #17
0
 void o3o_FetchTweets(UserDatabase.User usr)
 {
     fetch = new FetchTweets(prefetch);
     maindispatcher.Invoke(fetch, new object[] { usr });
 }
예제 #18
0
 public void Notification(TwitterStatus status, UserDatabase.User _usr)
 {
     if (o3o.Properties.Settings.Default.ShowNotificationPopup)
     {
         notify notification = new notify(this);
         TweetElement element;
         if (UsrDB.Users.Count > 1)
         {
             element = new TweetElement(this, status, _usr, ImageCache.GetImage(status.User.Id, status.User.ProfileImageLocation), true);
         }
         else
         {
             element = new TweetElement(this, status, _usr, ImageCache.GetImage(status.User.Id, status.User.ProfileImageLocation));
         }
         element.polyOpacity = polygonOpacity;
         notification.content.Items.Add(element);
         playsound();
     }
 }
예제 #19
0
 public void FillMentions(TwitterStatus status, UserDatabase.User _usr)
 {
     TweetElement element;
     if (UsrDB.Users.Count > 1)
     {
         element = new TweetElement(this, status, _usr, ImageCache.GetImage(status.User.Id, status.User.ProfileImageLocation), true);
     }
     else
     {
         element = new TweetElement(this, status, _usr, ImageCache.GetImage(status.User.Id, status.User.ProfileImageLocation));
     }
     element.polyOpacity = polygonOpacity;
     this.TweetMentions.Items.Insert(0, element);
     if (this.TweetMentions.Items.Count > o3o.Properties.Settings.Default.amountOfTWeetsToDisplay)
     {
         TweetElement el = (TweetElement)this.TweetMentions.Items[this.TweetElements.Items.Count - 1];
         this.TweetMentions.Items.Remove(el);
         el.Dispose();
     }
 }