Exemplo n.º 1
0
        Response server_RegisterReceived(Growl.Connector.Application application, List <NotificationType> notificationTypes, Growl.Connector.RequestInfo requestInfo)

        {
            if (requestInfo.PreviousReceivedHeaders.Count < 0)  // change to a positive number to forward

            {
                Forwarder fwd = new Forwarder(password, "127.0.0.1", Growl.Connector.GrowlConnector.TCP_PORT, requestInfo);

                fwd.EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.AES;

                fwd.Register(application, notificationTypes.ToArray());
            }



            Response response = new Response();

            return(response);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        Response server_NotifyReceived(Notification notification, Growl.Daemon.CallbackInfo callbackInfo, Growl.Connector.RequestInfo requestInfo)

        {
            Response response = new Response();



            if (callbackInfo != null)

            {
                if (callbackInfo.ShouldKeepConnectionOpen())

                {
                    response.SetCallbackData(notification.ID, callbackInfo.Context, Growl.CoreLibrary.CallbackResult.CLICK);



                    // simulate a wait

                    System.Threading.Thread.Sleep(5000);
                }

                else

                {
                    string url = callbackInfo.Context.CallbackUrl;

                    server_ServerMessage(null, Growl.Daemon.GrowlServer.LogMessageType.Information, url);
                }
            }



            //Console.WriteLine("notification response");

            return(response);
        }
 public override void ForwardNotification( Notification notification, CallbackContext callbackContext, RequestInfo requestInfo, bool isIdle, ForwardedNotificationCallbackHandler callbackFunction )
 {
     //notify.ShowBalloonTip ( 4000, notification.Title, notification.Text, ToolTipIcon.Info );
 }
 public override void ForwardRegistration( Connector.Application application, List<NotificationType> notificationTypes, RequestInfo requestInfo, bool isIdle )
 {
     // do nothing
 }
        public override void ForwardNotification(Growl.Connector.Notification notification, Growl.Connector.CallbackContext callbackContext, Growl.Connector.RequestInfo requestInfo, bool isIdle, ForwardedNotificationCallbackHandler callbackFunction)

        {
            Forwarder growl = new Forwarder(this.Password, this.IPAddress, this.Port, requestInfo);

            growl.KeyHashAlgorithm = this.HashAlgorithm;

            growl.EncryptionAlgorithm = this.EncryptionAlgorithm;

#if DEBUG
            //growl.EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.PlainText;
#endif

            growl.ForwardedNotificationCallback += callbackFunction;

            growl.Notify(notification, callbackContext);
        }
        public override void ForwardRegistration(Growl.Connector.Application application, List <Growl.Connector.NotificationType> notificationTypes, Growl.Connector.RequestInfo requestInfo, bool isIdle)

        {
            //UoS: stop forwarding registrations to remote clients
            if (!ApplicationMain.NoforwardregistrationMode)
            {
                Forwarder growl = new Forwarder(this.Password, this.IPAddress, this.Port, requestInfo);

                growl.KeyHashAlgorithm = this.HashAlgorithm;

                growl.EncryptionAlgorithm = this.EncryptionAlgorithm;

#if DEBUG
                //growl.EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.PlainText;
#endif

                growl.Register(application, notificationTypes.ToArray());
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Called when an application registration is received by GfW.
 /// </summary>
 /// <param name="application">The application.</param>
 /// <param name="notificationTypes">The notification types.</param>
 /// <param name="requestInfo">The request info.</param>
 /// <param name="isIdle"><c>true</c> if the user is currently idle;<c>false</c> otherwise</param>
 /// <remarks>
 /// Many types of forwarders can just ignore this event.
 /// </remarks>
 public override void ForwardRegistration(Growl.Connector.Application application,
                                          List <Growl.Connector.NotificationType> notificationTypes,
                                          Growl.Connector.RequestInfo requestInfo, bool isIdle)
 {
     // do nothing
 }
 /// <summary>
 /// Called when a notification is received by GfW.
 /// </summary>
 /// <param name="notification">The notification information</param>
 /// <param name="callbackContext">The callback context.</param>
 /// <param name="requestInfo">The <see cref="Growl.Connector.RequestInfo"/> associated with the notification request</param>
 /// <param name="isIdle"><c>true</c> if the user is currently idle;<c>false</c> otherwise</param>
 /// <param name="callbackFunction">The function GfW will run if this notification is responded to on the forwarded computer</param>
 /// <remarks>
 /// Unless your forwarder is going to handle socket-style callbacks from the remote computer, you should ignore
 /// the <paramref name="callbackFunction"/> parameter.
 /// </remarks>
 public abstract void ForwardNotification(Growl.Connector.Notification notification, Growl.Connector.CallbackContext callbackContext, Growl.Connector.RequestInfo requestInfo, bool isIdle, ForwardedNotificationCallbackHandler callbackFunction);
 /// <summary>
 /// Called when an application registration is received by GfW.
 /// </summary>
 /// <param name="application">The <see cref="Growl.Connector.Application"/> that is registering</param>
 /// <param name="notificationTypes">A list of <see cref="Growl.Connector.NotificationType"/>s being registered</param>
 /// <param name="requestInfo">The <see cref="Growl.Connector.RequestInfo"/> associated with the registration request</param>
 /// <param name="isIdle"><c>true</c> if the user is currently idle;<c>false</c> otherwise</param>
 public abstract void ForwardRegistration(Growl.Connector.Application application, List <Growl.Connector.NotificationType> notificationTypes, Growl.Connector.RequestInfo requestInfo, bool isIdle);