Esempio n. 1
0
        void sc_OKResponse(Growl.Daemon.SubscriptionResponse response)

        {
            Console.WriteLine("you were subscribed - TTL: " + response.TTL.ToString());

            this.server.PasswordManager.Add(password + this.subscriberID, true);
        }
Esempio n. 2
0
        void sc_ErrorResponse(Growl.Daemon.SubscriptionResponse response)

        {
            Console.WriteLine("failed to subscribe: " + response.ErrorDescription);

            //this.server.PasswordManager.Remove(password);
        }
Esempio n. 3
0
        Growl.Daemon.SubscriptionResponse server_SubscribeReceived(Growl.Daemon.Subscriber subscriber, Growl.Connector.RequestInfo requestInfo)

        {
            Growl.Daemon.SubscriptionResponse r = new Growl.Daemon.SubscriptionResponse(300);

            return(r);
        }
        void sc_ErrorResponse(Growl.Daemon.SubscriptionResponse response)
        {
            this.isSubscribing = false;
            string additionalInfo = (this.Enabled ? (response.ErrorCode == Growl.Connector.ErrorCode.NOT_AUTHORIZED ? "invalid password" : "server unavailable") : null);

            ChangeStatus(false, additionalInfo);

            // if the subscription failed, the SubscriptionConnector will take care of trying to reestablish it
        }
        void sc_OKResponse(Growl.Daemon.SubscriptionResponse response)
        {
            this.isSubscribing = false;
            string additionalInfo = (this.Enabled ? String.Format("TTL: {0}", response.TTL) : null);

            this.Platform = KnownDestinationPlatformType.FromString(response.PlatformName);
            ChangeStatus(true, additionalInfo);

            // if the subscription succeeds, the SubscriptionConnecter will take care of keeping the subscription alive
        }
Esempio n. 6
0
        void sc_ErrorResponse(Growl.Daemon.SubscriptionResponse response)
        {
            if (this.Enabled)
            {
                this.AdditionalOfflineDisplayInfo = (response.ErrorCode == Growl.Connector.ErrorCode.NOT_AUTHORIZED ? "invalid password" : "server unavailable");
                this.AdditionalOnlineDisplayInfo  = null;
            }
            this.available = false;
            OnStatusChanged();

            // if the subscription failed, the SubscriptionConnector will take care of trying to reestablish it
        }
Esempio n. 7
0
        void sc_OKResponse(Growl.Daemon.SubscriptionResponse response)
        {
            if (this.Enabled)
            {
                this.AdditionalOfflineDisplayInfo = null;
                this.AdditionalOnlineDisplayInfo  = String.Format("TTL: {0}", response.TTL);
            }
            this.Platform  = ForwardDestinationPlatformType.FromString(response.PlatformName);
            this.available = true;
            OnStatusChanged();

            // if the subscription succeeds, the SubscriptionConnecter will take care of keeping the subscription alive
        }
Esempio n. 8
0
        Growl.Daemon.SubscriptionResponse gntpListener_SubscribeReceived(Growl.Daemon.Subscriber subscriber, Growl.Connector.RequestInfo requestInfo)
        {
            bool alertUser = true;
            int ttl = Properties.Settings.Default.SubscriptionTTL;

            SubscribedForwardDestination subscribedComputer = null;
            if (this.forwards.ContainsKey(subscriber.ID))
            {
                ForwardDestination fc = this.forwards[subscriber.ID];
                subscribedComputer = fc as SubscribedForwardDestination;
                if (subscribedComputer != null)
                {
                    alertUser = false;
                }
            }

            if (subscribedComputer == null)
            {
                subscribedComputer = new SubscribedForwardDestination(subscriber, ttl);
                subscribedComputer.Unsubscribed += new SubscribedForwardDestination.SubscribingComputerUnscubscribedEventHandler(sfc_Unsubscribed);
                AddForwardDestination(subscribedComputer);
            }

            subscribedComputer.Renew();

            if (alertUser)
            {
                string title = Properties.Resources.SystemNotification_ClientSubscribed_Title;
                string text = String.Format(Properties.Resources.SystemNotification_ClientSubscribed_Text, subscriber.Name);
                SendSystemNotification(title, text);
            }

            Growl.Daemon.SubscriptionResponse response = new Growl.Daemon.SubscriptionResponse(ttl);

            // SUBSCRIBE requests are *not* forwarded (it could cause an endless loop, and it doesnt make sense anyway)

            return response;
        }
Esempio n. 9
0
 Growl.Daemon.SubscriptionResponse server_SubscribeReceived(Growl.Daemon.Subscriber subscriber, Growl.Connector.RequestInfo requestInfo)
 {
     Growl.Daemon.SubscriptionResponse r = new Growl.Daemon.SubscriptionResponse(300);
     return r;
 }