コード例 #1
0
        public virtual Invite Invite(Member member)
        {
            var invite = new Invite(Id, member.Id)
            {
                Guild  = this,
                Member = member
            };

            Invites.Add(invite);
            return(invite);
        }
コード例 #2
0
 void PrintAvailableInviteChannelsDetails()
 {
     Invites.GetAvailableChannels((inviteChannels) => {
         _currentInviteChannels = inviteChannels.ToArray();
         var channels           = _currentInviteChannels.ToList().ConvertAll(x => x.ToString()).ToArray();
         var channelsJoined     = string.Join(", ", channels);
         _console.LogD(string.Format("Available invite channels: {0}", channelsJoined));
     }, (error) => {
         _console.LogE("Error while getting invite channels: " + error.Message);
     });
 }
コード例 #3
0
 GroupInvite IGroupInvitesThisInterface.this[UGUI requestingAgent, UUID groupInviteID]
 {
     get
     {
         GroupInvite invite;
         if (Invites.TryGetValue(requestingAgent, groupInviteID, out invite))
         {
             return(invite);
         }
         throw new KeyNotFoundException();
     }
 }
コード例 #4
0
 public void DeclineInvite(Character decliner)
 {
     if (Invites.ContainsKey(decliner.ID))
     {
         _log.Debug($"Invite to party {partyId} has been declined by {decliner.ID}");
         Invites.Remove(decliner.ID);
         leader.SendPacket(PartyPacket.PartyErrorWithName(PartyFunction.INVITE_REJECTED, decliner.Name));
     }
     else
     {
         Program.MainForm.LogAppend("Trying to decline party invite while no invite exists. CharacterID: {0}, party ID {1}", decliner.ID, partyId);
     }
 }
コード例 #5
0
    private void CallSetReferrerMethod()
    {
        var customData = new Dictionary <string, string>();

        customData[_key1] = _value1;
        customData[_key2] = _value2;
        customData[_key3] = _value3;
        Invites.SetReferrer(UserId.Create(_referrerId), _eventName, customData, () => {
            _console.LogD("Referrer was set");
        }, (error) => {
            _console.LogD("Failed to set referrer: " + error);
        });
    }
コード例 #6
0
        public void LoadProject(Project project)
        {
            if (project.Owner.CompanyName == null || project.Owner.CompanyName == string.Empty)
            {
                OwnerName = project.Owner.Name;
                OwnerType = string.Empty;
                Owner     = OwnerName;
            }
            else
            {
                OwnerName = project.Owner.CompanyName;
                OwnerType = "Company";
                Owner     = OwnerType + " " + OwnerName;
            }

            mInvitesStatic.Clear();
            Invites.Clear();
            TimesClickShowMore = 0;

            this.ProjectName = project.Title;
            this.Description = project.Description;
            this.CanEdit     = mCacheService.ProjectHeadingItem.ProjectHeading.UserIsCreator;



            foreach (var item in project.Invites)
            {
                mInvitesStatic.Add(item);
            }

            if (mInvitesStatic.Count > 3)
            {
                for (int i = 0; i < 3; i++)
                {
                    Invites.Add(mInvitesStatic[i]);
                }
                IsShowMoreButton = true;
            }
            else
            {
                foreach (var item in mInvitesStatic)
                {
                    Invites.Add(item);
                }
                IsShowMoreButton = false;
            }
        }
コード例 #7
0
        // NOTE: You must have the App Store ID set in your developer console project
        // in order for invitations to successfully be sent.
        public void SendInvite()
        {
            if (string.IsNullOrWhiteSpace(txtTitle.Value) ||
                string.IsNullOrWhiteSpace(txtMessage.Text))
            {
                AppDelegate.ShowMessage("Some information is missing…", "Please, fill all fields marked with *.", ParentViewController);
                return;
            }

            // When you create the invitation dialog, you must specify the title
            // of the invitation dialog and the invitation message to send.
            // You can also customize the image and deep link URL that
            // get sent in the invitation
            var inviteDialog = Invites.GetInviteDialog();

            inviteDialog.SetInviteDelegate(this);
            inviteDialog.SetTitle(txtTitle.Value);
            inviteDialog.SetMessage(txtMessage.Text);

            if (!string.IsNullOrWhiteSpace(txtDeepLink.Value))
            {
                inviteDialog.SetDeepLink(txtDeepLink.Value);
            }

            if (!string.IsNullOrWhiteSpace(txtCustomImage.Value))
            {
                inviteDialog.SetCustomImage(txtCustomImage.Value);
            }

            if (!string.IsNullOrWhiteSpace(txtCallToAction.Value))
            {
                inviteDialog.SetCallToActionText(txtCallToAction.Value);
            }


            // If you have an Android version of your app and you want to send
            // an invitation that can be opened on Android in addition to iOS
            if (!string.IsNullOrWhiteSpace(txtAndroidId.Value))
            {
                var targetApp = new InvitesTargetApplication {
                    AndroidClientId = txtAndroidId.Value
                };
                inviteDialog.SetOtherPlatformsTargetApplication(targetApp);
            }

            inviteDialog.Open();
        }
コード例 #8
0
ファイル: ViewInvitesViewModel.cs プロジェクト: ckc/WinApp
        private async Task ProcessInvite(Invite invite)
        {
            await invitesTable.UpdateAsync(invite);

            Invites.Remove(invite);
            if (Invites.Count > 0)
            {
                parent.IsPendingInvitesButtonVisible = true;
                parent.ViewInvitesCommand.IsEnabled  = true;
            }
            else
            {
                flyoutProvider.HideViewInvitesFlyout();
                parent.IsPendingInvitesButtonVisible = false;
                parent.ViewInvitesCommand.IsEnabled  = false;
            }
        }
コード例 #9
0
        public void InvitePlayer(Player invitor, Player invitedPlayer)
        {
            if (Invites.ContainsKey(invitedPlayer.CharacterId))
            {
                return;
            }

            Invites[invitedPlayer.CharacterId] = invitedPlayer;

            invitedPlayer.SendTextMessage(MessageTypes.InfoDescription, string.Format("{0} invites you to {1} private chat channel.", invitor.CharacterName, GenderStringifier.Stringify(invitor)));

            invitor.SendTextMessage(MessageTypes.InfoDescription, string.Format("{0} has been invited.", invitedPlayer.CharacterName));

            foreach (Player user in Users.Values)
            {
                user.SendChannelEvent(Id, invitedPlayer.CharacterName, ChatChannelEvents.Invite);
            }
        }
コード例 #10
0
 public string invite(Invites invites)
 {
     try
     {
         foreach (var invite in invites.Invite)
         {
             var token = Guid.NewGuid().ToString();
             invite.inviteToken = token;
             result             = orm.execObject <Result>(invite, "api.company_invite");
             var link = string.Format("{0}{1}{2}", Globals.Instance.settings["RootUrl"],
                                      Globals.Instance.settings["CompanyInvite"], invite.inviteToken);
             Mail.enqueue(new CompanyInviteEmail(invite.email, invite.name, invite.invitorName, link));
         }
     }
     catch (Exception exp)
     {
         errorResult(exp);
     }
     return(formattedResult(result));
 }
コード例 #11
0
        public async void InitData()
        {
            if (mCacheService.ProjectHeadingItem != null)
            {
                var projectId = mCacheService.ProjectHeadingItem.ProjectHeading.ProjectId;
                mPlatformService.ShowNetworkIndicator();
                mProgressDialogService.ShowProgressDialog();

                var response = await mApiService.ViewProject(projectId);



                mInvitesStatic.Clear();
                Invites.Clear();
                TimesClickShowMore = 0;

                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    Project = response.Data;
                    if (Project.UserId == mCacheService.CurrentUserData.UserId)
                    {
                        IsShowInvitee = true;
                        View.ShowInvitee();
                    }
                    else
                    {
                        IsShowInvitee = false;
                        View.HidenInvitee();
                    }
                    LoadProject(Project);
                    IsLoading = false;
                }
                else
                {
                    IsShowMoreButton = false;
                }
                mPlatformService.HideNetworkIndicator();
                mProgressDialogService.HideProgressDialog();
            }
        }
コード例 #12
0
        private void SearchSuggestedContacts()
        {
            if (mSearchTokenSource != null)
            {
                mSearchTokenSource.Cancel();
                mSearchTokenSource = null;
            }

            mSearchTokenSource = new CancellationTokenSource();
            var token = mSearchTokenSource.Token;

            Task.Run(async() =>
            {
                await Task.Delay(500, token);

                mPlatformService.ShowNetworkIndicator();

                var result = await mApiService.GetContactList(EmailInvite);

                mPlatformService.HideNetworkIndicator();

                if (result.StatusCode == System.Net.HttpStatusCode.OK && result.Data != null)
                {
                    var realList = result.Data.Where(p => !Invites.Any(ct => ct.Invite.InviteeEmail == p.InviteeEmail));
                    if (realList.Count() > 0)
                    {
                        ShowSuggestedContacts = true;
                        SuggestedContacts     = new MvxObservableCollection <Invite>(realList);
                    }
                    else
                    {
                        ShowSuggestedContacts = false;
                    }
                }
                else
                {
                    ShowSuggestedContacts = false;
                }
            }, token);;
        }
コード例 #13
0
        // Support for iOS 8 or before
        public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
        {
            // Handle Sign In
            if (SignIn.SharedInstance.HandleUrl(url, sourceApplication ?? "", annotation))
            {
                return(true);
            }

            // Handle App Invite requests
            return(Invites.HandleUniversalLink(url, HandleInvitesUniversalLink));

            void HandleInvitesUniversalLink(ReceivedInvite receivedInvite, NSError error)
            {
                if (error != null)
                {
                    ShowMessage("Depp-Link Data", error.LocalizedDescription, Window.RootViewController);
                    return;
                }

                var message = $"Deep link from {sourceApplication}\nInvite ID: {receivedInvite.InviteId}\nApp Url: {receivedInvite.DeepLink}\nMatch Type: {receivedInvite.MatchType}";

                ShowMessage("Depp-Link Data", message, Window.RootViewController);
            }
        }
コード例 #14
0
 private void SelectSuggestedContact(Invite contact)
 {
     CancelAllSearch();
     Invites.Add(new InviteCreateProjectItemViewModel(this, contact));
     EmailInvite = string.Empty;
 }
コード例 #15
0
    public void SetupGetSocial()
    {
        Notifications.SetOnTokenReceivedListener(deviceToken => {
            _console.LogD(string.Format("DeviceToken: {0}", deviceToken), false);
        });
        Notifications.SetOnNotificationReceivedListener(notification => {
            // handle chat message
            if (notification.Action.Type.Equals("open_chat_message"))
            {
                _latestChatId = notification.Action.Data["open_messages_for_id"];
                if (GetSocial.IsInitialized)
                {
                    ShowChat();
                }
            }
            if (notification.Action.Type.Equals(GetSocialActionType.AddFriend))
            {
                ShowPopup(notification);
            }
            _console.LogD(string.Format("Notification received : {0}", notification));
        });
        Notifications.SetOnNotificationClickedListener((notification, context) => {
            _console.LogD(string.Format("Notification wasClicked : {0}", notification));
            HandleAction(notification.Action);
        });

        _console.LogD("Setting up GetSocial...");
        _getSocialUnitySdkVersion            = GetSocial.UnitySdkVersion;
        _getSocialUnderlyingNativeSdkVersion = GetSocial.NativeSdkVersion;

        GetSocialFBMessengerPluginHelper.RegisterFBMessengerPlugin();
        if (GetSocial.IsInitialized)
        {
            _console.LogD("GetSocial is initialized and user is retrieved");
            _currentUser  = GetSocial.GetCurrentUser();
            _isTestDevice = GetSocial.Device.IsTestDevice;
            FetchCurrentUserData();
        }
        else
        {
            GetSocial.AddOnCurrentUserChangedListener(user => {
                _console.LogD("GetSocial is initialized and user is retrieved");
                _currentUser  = user;
                _isTestDevice = GetSocial.Device.IsTestDevice;
                FetchCurrentUserData();
            });
        }

        Invites.SetOnReferralDataReceivedListener((referralData) => {
            var logMessage = string.Empty;

            if (referralData != null)
            {
                logMessage += string.Format("Token: {0}\n", referralData.Token);
                logMessage += string.Format("Referrer user id: {0}\n", referralData.ReferrerUserId);
                logMessage += string.Format("Referrer channel: {0}\n", referralData.ReferrerChannelId);
                logMessage += string.Format("Is first match: {0}\n", referralData.IsFirstMatch);
                logMessage += string.Format("Is guarateed match: {0}\n", referralData.IsGuaranteedMatch);
                logMessage += "Referral Link params:\n" + referralData.LinkParams.ToDebugString();
            }
            _console.LogD("Referral data: \n" + logMessage);
        });

        GetSocial.Init();
    }
コード例 #16
0
 public bool RemoveInvite(uint id)
 {
     return(Invites.Remove(id));
 }