Beispiel #1
0
 private void OnResourceRemoved(Contact contact)
 {
     try
     {
         ResourceRemoved(contact);
     }
     catch { }
 }
Beispiel #2
0
 void Roster_ActivityUpdated(nJim.Contact contact, Activity activity)
 {
     if ((Settings.notifyOnActivityPlugin && Helper.PLUGIN_WINDOW_ACTIVE) || Settings.notifyOnActivityGlobally && !Helper.PLUGIN_WINDOW_ACTIVE)
     {
         NotifyPresMooActTun(contact, null, activity, null);
     }
     OnUpdatedPresence(contact);
     AppendLogEvent(contact.lastUpdated, "Activity", contact.identity.nickname, Translations.GetByName(activity.type.ToString()));
 }
Beispiel #3
0
 void Roster_TuneUpdated(nJim.Contact contact, Tune tune)
 {
     if ((Settings.notifyOnTunePlugin && Helper.PLUGIN_WINDOW_ACTIVE) || Settings.notifyOnTuneGlobally && !Helper.PLUGIN_WINDOW_ACTIVE)
     {
         NotifyPresMooActTun(contact, null, null, tune);
     }
     OnUpdatedPresence(contact);
     AppendLogEvent(contact.lastUpdated, "Tune", contact.identity.nickname, tune.artist + " - " + tune.title);
 }
Beispiel #4
0
 void Roster_PresenceUpdated(nJim.Contact contact)
 {
     if (((Settings.notifyOnStatusPlugin && Helper.PLUGIN_WINDOW_ACTIVE) || Settings.notifyOnStatusGlobally && !Helper.PLUGIN_WINDOW_ACTIVE) && contact.identity.jabberID.full != Helper.JABBER_CLIENT.MyJabberID.full && contact.status.type != Enums.StatusType.Unavailable)
     {
         NotifyPresMooActTun(contact, null, null, null);
     }
     AppendLogEvent(contact.lastUpdated, "Status", contact.identity.nickname, Translations.GetByName(contact.status.type.ToString()));
     OnUpdatedPresence(contact);
 }
Beispiel #5
0
 void Roster_MoodUpdated(nJim.Contact contact, Mood mood)
 {
     if ((Settings.notifyOnMoodPlugin && Helper.PLUGIN_WINDOW_ACTIVE) || Settings.notifyOnMoodGlobally && !Helper.PLUGIN_WINDOW_ACTIVE)
     {
         NotifyPresMooActTun(contact, mood, null, null);
     }
     AppendLogEvent(contact.lastUpdated, "Mood", contact.identity.nickname, Translations.GetByName(mood.type.ToString()));
     OnUpdatedPresence(contact);
 }
Beispiel #6
0
        private void NotifyPresMooActTun(nJim.Contact contact, Mood?mood, Activity?activity, Tune?tune)
        {
            string message = String.Empty;

            Helper.PresMooActNotifyInfo notifyInfo = new Helper.PresMooActNotifyInfo();
            if (contact.identity.nickname != String.Empty)
            {
                notifyInfo.nickname = contact.identity.nickname;
            }
            else
            {
                notifyInfo.nickname = contact.identity.jabberID.user;
            }
            message = notifyInfo.nickname;

            notifyInfo.resource = contact.identity.jabberID.resource;
            notifyInfo.stamp    = contact.lastUpdated;
            notifyInfo.status   = Translations.GetByName(contact.status.type.ToString());
            notifyInfo.message  = contact.status.message;
            notifyInfo.icon     = Helper.GetStatusIcon(contact.status.type.ToString());

            if (mood.HasValue)
            {
                notifyInfo.mood    = mood.Value.type.ToString().ToUpperInvariant();
                notifyInfo.message = notifyInfo.mood;
                if (!String.IsNullOrEmpty(mood.Value.text))
                {
                    notifyInfo.message += "\n'" + mood.Value.text + "'";
                }
                notifyInfo.icon = Helper.GetMoodIcon(mood.Value.type.ToString());
            }
            if (activity.HasValue)
            {
                notifyInfo.activity = activity.Value.type.ToString().ToUpperInvariant();
                notifyInfo.message  = notifyInfo.activity;
                if (!String.IsNullOrEmpty(activity.Value.text))
                {
                    notifyInfo.message += "\n'" + activity.Value.text + "'";
                }
                notifyInfo.icon = Helper.GetActivityIcon(activity.Value.type.ToString());
            }
            if (tune.HasValue)
            {
                notifyInfo.tune    = string.Format("{0}\n{1}\n{2}", tune.Value.artist, tune.Value.title, tune.Value.length);
                notifyInfo.message = notifyInfo.tune;
                notifyInfo.icon    = Helper.GetTuneIcon(tune.Value);
            }
            if (!String.IsNullOrEmpty(notifyInfo.message))
            {
                message += "\n" + notifyInfo.message;
            }
            notifyInfo.header = string.Format("[{0}] {1} @ {2} ", notifyInfo.stamp.ToShortTimeString(), notifyInfo.status, notifyInfo.resource);

            Dialog.Instance.ShowNotifyDialog(notifyInfo.header, notifyInfo.icon, message, Settings.notifyWindowType);
        }
Beispiel #7
0
        void Roster_ResourceAdded(nJim.Contact contact)
        {
            Session newSession = new Session(contact);

            newSession.OnChatSessionUpdated += new OnChatSessionUpdatedEventHandler(newSession_OnChatSessionUpdated);
            if (!ChatSessions.Contains(newSession))
            {
                ChatSessions.Add(newSession);
                OnUpdatedRoster(contact);
                AppendLogEvent(contact.lastUpdated, "Added", contact.identity.nickname, Translations.GetByName(contact.status.type.ToString()));
            }
        }
Beispiel #8
0
 private void OnUnblocked(Contact contact)
 {
     try {
         Unblocked(contact);
     } catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }
Beispiel #9
0
 private void OnTuneUpdated(Contact contact, Tune tune)
 {
     // try {
         TuneUpdated(contact, tune);
        // } catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }
Beispiel #10
0
 private void OnResourceRemoved(Contact contact)
 {
     try {
         ResourceRemoved(contact);
     } catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }
Beispiel #11
0
 void History_OnRosterUpdated(Contact changedContact)
 {
     try {
         UpdateContactsFacade();
     } catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }
Beispiel #12
0
 private void OnLocationUpdated(Contact contact, Location location)
 {
     try
     {
         LocationUpdated(contact, location);
     }
     catch { }
 }
Beispiel #13
0
 private void OnMoodUpdated(Contact contact, Mood mood)
 {
     try
     {
         MoodUpdated(contact, mood);
     }
     catch { }
 }
Beispiel #14
0
 void Roster_ResourceRemoved(nJim.Contact contact)
 {
     ChatSessions.Remove(new Session(contact));
     OnUpdatedRoster(contact);
     AppendLogEvent(contact.lastUpdated, "Removed", contact.identity.nickname, Translations.GetByName(contact.status.type.ToString()));
 }
Beispiel #15
0
 private void OnBlocked(Contact contact)
 {
     try
     {
         Blocked(contact);
     }
     catch { }
 }
Beispiel #16
0
 private void OnActivityUpdated(Contact contact, Activity activity)
 {
     //try {
         ActivityUpdated(contact, activity);
     //} catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }
Beispiel #17
0
 private void OnUnblocked(Contact contact)
 {
     try
     {
         Unblocked(contact);
     }
     catch { }
 }
Beispiel #18
0
 private void OnLocationUpdated(Contact contact, Location location)
 {
     try {
         LocationUpdated(contact, location);
     } catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }
Beispiel #19
0
 private void OnActivityUpdated(Contact contact, Activity activity)
 {
     try
     {
         ActivityUpdated(contact, activity);
     }
     catch { }
 }
Beispiel #20
0
 private void OnMoodUpdated(Contact contact, Mood mood)
 {
     //try {
         MoodUpdated(contact, mood);
        // } catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }
Beispiel #21
0
 private void OnTuneUpdated(Contact contact, Tune tune)
 {
     try
     {
         TuneUpdated(contact, tune);
     }
     catch { }
 }
Beispiel #22
0
 private void OnPresenceUpdated(Contact contact)
 {
     try {
         PresenceUpdated(contact);
     } catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }
Beispiel #23
0
 private void OnPresenceUpdated(Contact contact)
 {
     try
     {
         PresenceUpdated(contact);
     }
     catch { }
 }
Beispiel #24
0
 void History_OnContactPresence(Contact updatedContact)
 {
     try {
         UpdateContactsFacade();
         UpdateGuiContactProperties(History.Instance.GetSession(updatedContact.identity.jabberID.full));
         //if (guiWindowChat.CurrentChatSession != null && updatedContact.identity.jabberID.bare.ToLower() == guiWindowChat.CurrentChatSession.ContactJID.Bare.ToLower()) {
         //    guiWindowChat.UpdateGuiContactProperties();
         //}
     } catch (Exception e) { Debug.WriteLine(e.ToString()); }
 }