コード例 #1
0
        public static void SendNotification(string targetUserId, ApiNotification.NotificationType nType, string message, Dictionary <string, object> details, Action <ApiNotification> successCallback, Action <string> errorCallback)
        {
            string value = nType.ToString().ToLower();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary["type"]    = value;
            dictionary["message"] = message;
            bool flag = details != null;

            if (flag)
            {
                dictionary["details"] = Json.Encode(details);
            }
            ApiModelContainer <ApiNotification> apiModelContainer = new ApiModelContainer <ApiNotification>();

            apiModelContainer.OnSuccess = delegate(ApiContainer c)
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("[Success] " + c.Text);
                Console.ForegroundColor = ConsoleColor.White;
            };
            apiModelContainer.OnError = delegate(ApiContainer c)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("[Fail] " + c.Text);
                Console.ForegroundColor = ConsoleColor.White;
            };
            ApiModelContainer <ApiNotification> responseContainer = apiModelContainer;

            VRC.Core.API.SendPostRequest("user/" + targetUserId + "/notification", responseContainer, dictionary, null);
        }
コード例 #2
0
    // Token: 0x0600610C RID: 24844 RVA: 0x00223E56 File Offset: 0x00222256
    public static QuickMenuSocialElement.IconType GetIconTypeForNotificationType(ApiNotification.NotificationType nType)
    {
        switch (nType)
        {
        case ApiNotification.NotificationType.Friendrequest:
            return(QuickMenuSocialElement.IconType.FriendRequest);

        case ApiNotification.NotificationType.Invite:
            return(QuickMenuSocialElement.IconType.Invite);

        case ApiNotification.NotificationType.Requestinvite:
            return(QuickMenuSocialElement.IconType.RequestInvite);

        case ApiNotification.NotificationType.VoteToKick:
            return(QuickMenuSocialElement.IconType.VoteToKick);

        case ApiNotification.NotificationType.Halp:
            return(QuickMenuSocialElement.IconType.HelpRequest);

        default:
            return(QuickMenuSocialElement.IconType.GenericNotification);
        }
    }
コード例 #3
0
    // Token: 0x06005350 RID: 21328 RVA: 0x001CA76C File Offset: 0x001C8B6C
    public List <ApiNotification> GetNotificationsOfType(ApiNotification.NotificationType t, NotificationManager.HistoryRange historyRange)
    {
        List <ApiNotification> list = new List <ApiNotification>();

        if (this.notifications.ContainsKey(historyRange))
        {
            if (t == ApiNotification.NotificationType.All)
            {
                foreach (KeyValuePair <ApiNotification.NotificationType, List <ApiNotification> > keyValuePair in this.notifications[historyRange])
                {
                    if (keyValuePair.Key != ApiNotification.NotificationType.Hidden)
                    {
                        list.AddRange(keyValuePair.Value);
                    }
                }
            }
            else if (this.notifications[historyRange].ContainsKey(t))
            {
                list = new List <ApiNotification>(this.notifications[historyRange][t]);
            }
        }
        return(list);
    }
コード例 #4
0
 static void smethod_30(string string_0, ApiNotification.NotificationType notificationType_0, string string_1, Dictionary <string, object> dictionary_0, Action <ApiNotification> action_0, Action <string> action_1)
 {
     ApiNotification.SendNotification(string_0, notificationType_0, string_1, dictionary_0, action_0, action_1);
 }
コード例 #5
0
 // Token: 0x06005351 RID: 21329 RVA: 0x001CA834 File Offset: 0x001C8C34
 public bool HasNotificationsOfType(ApiNotification.NotificationType t, NotificationManager.HistoryRange historyRange)
 {
     return(this.GetNotificationsOfType(t, historyRange).Count > 0);
 }