예제 #1
0
파일: StatusEntry.cs 프로젝트: GNOME/banter
        public StatusEntry()
        {
            ModifyBg (StateType.Normal, Style.Background (StateType.Active));
            BorderWidth = 0;

            customAvailableMessages = new SerializableDictionary<string,string> ();
            customBusyMessages = new SerializableDictionary<string,string> ();
            customAwayMessages = new SerializableDictionary<string,string> ();

            presence = null;
            potentialPresenceType = PresenceType.Offline;

            notebook = new Notebook ();
            notebook.ModifyBg (StateType.Normal, Style.Background (StateType.Active));
            notebook.ShowTabs = false;
            notebook.ShowBorder = false;

            notebook.AppendPage (CreateViewWidget (), new Label ());
            notebook.AppendPage (CreateEditWidget (), new Label());

            notebook.Show ();

            Add (notebook);
        }
예제 #2
0
        /// <summary>
        /// Signal called when presence changes for the peer user.
        /// </summary>
        private void OnPeerPresenceUpdated(ProviderUser user)
        {
            string msg;
            Banter.SystemMessage systemMessage = null;

            // no handlers?  exit
            if (MessageReceived == null) return;

            string displayName = (user.Alias != null) ? user.Alias.Split (' ')[0] : user.Uri;
            if (user.Presence.Type == Banter.PresenceType.Offline) {
                msg = String.Format("{0} has gone {1}", displayName, user.Presence.Name);
                systemMessage = new Banter.SystemMessage (msg);
            } else {
                if (user.Presence.Message != null &&
                    user.Presence.Message != String.Empty &&
                    user.Presence.Message != lastPeerPresence.Message) {

                    msg = String.Format(
                            "{0} is {1} \"{2}\"",
                            displayName,
                            user.Presence.Name,
                            user.Presence.Message);
                    systemMessage = new Banter.SystemMessage (msg);

                } else {
                    msg = String.Format("{0} is {1}", displayName, user.Presence.Name);
                    systemMessage = new Banter.SystemMessage (msg);
                }
            }

            lastPeerPresence = user.Presence;

            // Indicate the message to registered handlers
            if (systemMessage != null)
                MessageReceived (this, systemMessage);
        }
예제 #3
0
 private void Init(Account account, ProviderUser providerUser)
 {
     this.account = account;
     this.tlpConnection = this.account.TlpConnection;
     this.peerUser = providerUser;
     this.callType = CallType.None;
     this.messages = new List<Message> ();
     this.last = 999;
     this.videoStreams = new Dictionary<uint,uint> ();
     this.audioStreams = new Dictionary<uint,uint> ();
     this.peerUser.PresenceUpdated += OnPeerPresenceUpdated;
     this.lastPeerPresence = this.peerUser.Presence;
     this.inRemoveMedia = false;  //hack
 }
예제 #4
0
파일: GroupWindow.cs 프로젝트: GNOME/banter
        private void OnStatusEntryChanged(Presence presence)
        {
            //Logger.Debug ("Setting presence on Me to {0}", presence.Message);
            if (PersonManager.Me != null) {
                PersonManager.Me.SetStatus (presence);

                Logger.Debug ("FIXME: Save off a custom presence message so when Banter restarts, they'll be available.");
            }
        }
예제 #5
0
파일: StatusEntry.cs 프로젝트: GNOME/banter
 public StatusMenuItem(Presence presence)
     : base(presence.Message)
 {
     this.presence = presence;
 }
예제 #6
0
파일: StatusEntry.cs 프로젝트: GNOME/banter
        private void OnStatusEntryActivated(object sender, EventArgs args)
        {
            string potentialMessage = statusEntry.Text.Trim ();

            if (potentialMessage.Length > 0) {
                if (potentialPresenceType != PresenceType.Offline)
                    Presence = new Presence (potentialPresenceType, potentialMessage);
                else
                    Presence = new Presence (presence.Type, potentialMessage);
            }
            this.SaveStatus ();
            SwitchToViewMode ();
        }
예제 #7
0
파일: StatusEntry.cs 프로젝트: GNOME/banter
 private void OnBusyMessageSelected(object sender, EventArgs args)
 {
     StatusMenuItem item = sender as StatusMenuItem;
     Presence = new Presence(PresenceType.Busy, item.Message);
 }