예제 #1
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);
        }
예제 #2
0
 public void ShowErrorDialog(nJim.Enums.ErrorType type, string message)
 {
     Dialog.Instance.ShowNotifyDialog(2 * Settings.notifyTimeOut,
         Helper.PLUGIN_NAME + " Error!",
         Helper.MEDIA_ICON_ERROR,
         type.ToString() + "\n" + message,
         Helper.PLUGIN_NOTIFY_WINDOWS.WINDOW_DIALOG_NOTIFY
     );
 }
예제 #3
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()));
        }
 }
예제 #4
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()));
 }
예제 #5
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);
 }
예제 #6
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);
 }
예제 #7
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()));
        }
예제 #8
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);
        }
예제 #9
0
 public TestEventArgs(bool successful, nJim.Enums.ErrorType? errorType, string ErrorMessage)
 {
     _success = successful;
     _errorType = errorType;
     _errorMessage = ErrorMessage;
 }