Esempio n. 1
0
        private void RefreshListedFavorites()
        {
            lbFavs.Items.Clear();
            rtbFavs.Clear();

            listedfavs = dc.GetFavoriteList(cbIRCServers.Text);
            foreach (KeyValuePair <string, ChanFav> cf in listedfavs)
            {
                lbFavs.Items.Add(cf.Value.channel);
                rtbFavs.AppendText(cf.Value.channel + " notify in " + cf.Value.NotifyMinute + "\n");
            }
        }
Esempio n. 2
0
        internal void CheckChannel(string server, string scChannel, PrivMsgEventArgs nPME)
        {
            Dictionary <string, ChanFav> favs;

            favs = dc.GetFavoriteList(server);
            ChanFav cf;

            if (favs.TryGetValue(scChannel, out cf))
            {
                dc.UpdateChanFavLast();
                if (cf.Last == null)
                {
                    return;
                }
                DateTime activity  = cf.Last;
                int      Threshold = cf.NotifyMinute;
                if (cf.NotifyMinute == 0)
                {
                    return;
                }
                activity = activity.AddMinutes(Threshold);
                if (activity > DateTime.Now)
                { //if added activity time > currenttime then no need to notify, get out.
                    return;
                }
                string ph;
                if (cf.Phonetic.Length == 0)
                {
                    ph = cf.channel;
                }
                else
                {
                    ph = cf.Phonetic;
                }

                if (ph.ToLower() == "notset")
                {
                    return;
                }
                speaker.Speak("channel " + ph + " has activity from " + nPME.User.Nick);
            }
        }