private static void PowerManager_UserPresenceStatusChanged(object sender, object e)
        {
            UserPresenceStatus userStatus = PowerManager.UserPresenceStatus;

            OutputMessage($"User presence status changed: {userStatus}");
            DetermineWorkloads();
        }
Beispiel #2
0
 public User(IntPtr o)
 {
     ID             = CAPI.ovr_User_GetID(o);
     ImageURL       = CAPI.ovr_User_GetImageUrl(o);
     InviteToken    = CAPI.ovr_User_GetInviteToken(o);
     OculusID       = CAPI.ovr_User_GetOculusID(o);
     Presence       = CAPI.ovr_User_GetPresence(o);
     PresenceStatus = CAPI.ovr_User_GetPresenceStatus(o);
     SmallImageUrl  = CAPI.ovr_User_GetSmallImageUrl(o);
 }
Beispiel #3
0
 public User(IntPtr o)
 {
     ID                         = CAPI.ovr_User_GetID(o);
     ImageURL                   = CAPI.ovr_User_GetImageUrl(o);
     InviteToken                = CAPI.ovr_User_GetInviteToken(o);
     OculusID                   = CAPI.ovr_User_GetOculusID(o);
     Presence                   = CAPI.ovr_User_GetPresence(o);
     PresenceDeeplinkMessage    = CAPI.ovr_User_GetPresenceDeeplinkMessage(o);
     PresenceDestinationApiName = CAPI.ovr_User_GetPresenceDestinationApiName(o);
     PresenceStatus             = CAPI.ovr_User_GetPresenceStatus(o);
     SmallImageUrl              = CAPI.ovr_User_GetSmallImageUrl(o);
 }
Beispiel #4
0
        private void gTalkClient_PresenceChanged(string From, string StatusText, UserPresenceStatus Status)
        {
            foreach (ContactControl cc in ContactList)
            {
                if (From.IndexOf(cc.Email) != -1)
                {
                    cc.JID = From;

                    cc.StatusTextLabel.Text = StatusText;
                    cc.StatusLabel.Text = Status.ToString();

                    if (Status == UserPresenceStatus.Online)
                    {
                        cc.StatusLabel.ForeColor = Color.Green;
                        ListPanel.Controls.SetChildIndex(cc, ListPanel.Controls.Count - 1);
                    }

                    if (Status == UserPresenceStatus.Offline)
                    {
                        cc.StatusLabel.ForeColor = Color.Gray;
                        ListPanel.Controls.SetChildIndex(cc, 0);
                    }

                    if (Status == UserPresenceStatus.Away)
                    {
                        cc.StatusLabel.ForeColor = Color.OrangeRed;
                        ListPanel.Controls.SetChildIndex(cc, ListPanel.Controls.Count - 1);
                    }

                    if (Status == UserPresenceStatus.Busy)
                    {
                        cc.StatusLabel.ForeColor = Color.Red;
                        ListPanel.Controls.SetChildIndex(cc, ListPanel.Controls.Count - 1);
                    }
                }

                foreach (ContactControl oc in ContactList)
                {
                    if (oc.StatusLabel.Text == "Online") ListPanel.Controls.SetChildIndex(oc, ListPanel.Controls.Count - 1);
                }
            }

            if (From.IndexOf(EmailTextBox.Text) != -1)// User status update from another client
            {
                textBox3.Text = StatusText;
                if (textBox3.Text == "") textBox3.Text = "<Enter status text here>";
                textBox3.ForeColor = Color.Gray;
            }
        }
Beispiel #5
0
 public UserPresence(UserPresenceStatus userPresenceStatus)
 {
     Status = userPresenceStatus;
 }
Beispiel #6
0
        void SetPresenceStatus(String StatusText, UserPresenceStatus Status)
        {
            String st = "<status/>";
            if (StatusText != "") st = "<status>" + StatusText.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;").Replace("'", "&apos;") + "</status>";

            switch (Status)
            {
                case UserPresenceStatus.Online: SendXml("<presence><show></show>" + st + "</presence>"); break;
                case UserPresenceStatus.Offline: SendXml("<presence type=\"unavailable\"/>"); break;
                case UserPresenceStatus.Away: SendXml("<presence><show>away</show>" + st + "</presence>"); break;
                case UserPresenceStatus.Busy: SendXml("<presence><show>dnd</show>" + st + "</presence>"); break;
            }
        }
Beispiel #7
0
 protected virtual void OnPresenceChanged(String From, String StatusText, UserPresenceStatus Status)
 {
     try
     {
         if (PresenceChanged != null)
         {
             Control control = PresenceChanged.Target as Control;
             if (control != null && control.InvokeRequired)
             {
                 control.Invoke(PresenceChanged, new object[] { From, StatusText, Status });
             }
             else
             {
                 PresenceChanged(From, StatusText, Status);
             }
         }
     }
     catch (Exception) { }
 }
Beispiel #8
0
        void SetPresenceStatus(String StatusText, UserPresenceStatus Status)
        {
            String st = "<status/>";
            if (StatusText != "") st = "<status>" + StatusText + "</status>";

            switch (Status)
            {
                case UserPresenceStatus.Online: SendXml("<presence><show></show>" + st + "</presence>"); break;
                case UserPresenceStatus.Offline: SendXml("<presence type=\"unavailable\"/>"); break;
                case UserPresenceStatus.Away: SendXml("<presence><show>away</show>" + st + "</presence>"); break;
                case UserPresenceStatus.Busy: SendXml("<presence><show>dnd</show>" + st + "</presence>"); break;
            }
        }