Ejemplo n.º 1
0
        private static void AcceptNotificationPatch(IntPtr thisPtr, IntPtr notificationPtr)
        {
            try
            {
                if (thisPtr == IntPtr.Zero ||
                    notificationPtr == IntPtr.Zero)
                {
                    return;
                }
                if (Utilities.GetStreamerMode())
                {
                    acceptNotificationDelegate(thisPtr, notificationPtr);
                    return;
                }

                Notification notification = new Notification(notificationPtr);
                if (notification.notificationType.Equals("invite", StringComparison.OrdinalIgnoreCase))
                {
                    InviteHandler.HandleInvite(notification);
                    return;
                }
            }
            catch (Exception e)
            {
                MelonLogger.Error($"Exception in accept notification patch: {e}");
            }

            acceptNotificationDelegate(thisPtr, notificationPtr);
        }
Ejemplo n.º 2
0
        private static void AcceptNotificationPatch(IntPtr thisPtr, IntPtr notificationPtr, IntPtr returnedException)
        {
            try
            {
                if (thisPtr == IntPtr.Zero ||
                    notificationPtr == IntPtr.Zero)
                {
                    return;
                }

                if (Utilities.GetStreamerMode())
                {
                    acceptNotificationDelegate(thisPtr, notificationPtr, returnedException);
                    return;
                }

                Notification notification = new Notification(notificationPtr);

#if DEBUG
                try
                {
                    Utilities.LoggerInstance.Msg("AcceptNotification: " + notification.notificationType);
                }
                catch { }
#endif

                if (notification.notificationType != null && notification.notificationType.Equals("invite", StringComparison.OrdinalIgnoreCase))
                {
                    InviteHandler.HandleInvite(notification);
                    return;
                }
            }
            catch (Exception e)
            {
                Utilities.LoggerInstance.Error($"Exception in accept notification patch: {e}");
            }

            acceptNotificationDelegate(thisPtr, notificationPtr, returnedException);
        }