예제 #1
0
 private void onRemove()
 {
     if (FriendList.removeFriend(friend) == true)
     {
         displaySpixiAlert("Removed", "Contact removed from list.", "OK");
     }
 }
예제 #2
0
 private void onRemove()
 {
     if (friend.bot && friend.metaData.botInfo != null)
     {
         friend.pendingDeletion = true;
         friend.save();
         Node.shouldRefreshContacts = true;
         StreamProcessor.sendLeave(friend, null);
         displaySpixiAlert(SpixiLocalization._SL("contact-details-removedcontact-title"), SpixiLocalization._SL("contact-details-removedcontact-text"), SpixiLocalization._SL("global-dialog-ok"));
     }
     else
     {
         if (FriendList.removeFriend(friend) == true)
         {
             displaySpixiAlert(SpixiLocalization._SL("contact-details-removedcontact-title"), SpixiLocalization._SL("contact-details-removedcontact-text"), SpixiLocalization._SL("global-dialog-ok"));
         }
     }
 }
예제 #3
0
        public void onRequest(byte[] recipient_address)
        {
            try
            {
                if (Address.validateChecksum(recipient_address) == false)
                {
                    displaySpixiAlert(SpixiLocalization._SL("global-invalid-address-title"), SpixiLocalization._SL("global-invalid-address-text"), SpixiLocalization._SL("global-dialog-ok"));
                    return;
                }

                if (recipient_address.SequenceEqual(Node.walletStorage.getPrimaryAddress()))
                {
                    displaySpixiAlert(SpixiLocalization._SL("global-invalid-address-title"), SpixiLocalization._SL("contact-new-invalid-address-self-text"), SpixiLocalization._SL("global-dialog-ok"));
                    return;
                }

                Friend old_friend = FriendList.getFriend(recipient_address);
                if (old_friend != null)
                {
                    if (old_friend.pendingDeletion)
                    {
                        FriendList.removeFriend(old_friend);
                    }
                    else
                    {
                        displaySpixiAlert(SpixiLocalization._SL("global-invalid-address-title"), SpixiLocalization._SL("contact-new-invalid-address-exists-text"), SpixiLocalization._SL("global-dialog-ok"));
                        return;
                    }
                }

                Friend friend = FriendList.addFriend(recipient_address, null, Base58Check.Base58CheckEncoding.EncodePlain(recipient_address), null, null, 0);

                if (friend != null)
                {
                    friend.save();

                    StreamProcessor.sendContactRequest(friend);
                }
            }catch (Exception)
            {
            }

            Navigation.PopAsync(Config.defaultXamarinAnimations);
        }