Ejemplo n.º 1
0
        public void CreateRequest(NotificationRequestType requestType, string account, string from)
        {
            try
            {
                var accountObj = Frontend.Accounts[account];
                if (accountObj == null)
                {
                    return;
                }

                var fromJID = new JID(from);
                var contact = accountObj.Roster[fromJID.Bare];
                if (contact == null)
                {
                    return;
                }


                var notification = new Notification();
                notification.Account = account;
                notification.Type    = NotificationType.Request;

                if (requestType == NotificationRequestType.Subscribe)
                {
                    notification.Message = fromJID.Bare + " " + Helper.Translate("SubscriptionRequest");
                    notification.Action  = FlyoutType.Subscription;
                    notification.Data    = contact;
                }

                AddNotification(notification);
            }
            catch (Exception uiEx) { Frontend.UIError(uiEx); }
        }
Ejemplo n.º 2
0
        public void CreateRequest(NotificationRequestType requestType, string account, string from)
        {
            try
            {
                var accountObj = Frontend.Accounts[account];
                if (accountObj == null)
                    return;

                var fromJID = new JID(from);
                var contact = accountObj.Roster[fromJID.Bare];
                if (contact == null)
                    return;


                var notification = new Notification();
                notification.Account = account;
                notification.Type = NotificationType.Request;

                if (requestType == NotificationRequestType.Subscribe)
                {
                    notification.Message = fromJID.Bare + " " + Helper.Translate("SubscriptionRequest");
                    notification.Action = FlyoutType.Subscription;
                    notification.Data = contact;
                }

                AddNotification(notification);
            }
            catch (Exception uiEx) { Frontend.UIError(uiEx); }
        }