示例#1
0
        private void EncryptedChatOnUserKeyReceived(object sender, CryptedChatPlainUserEventArgs ea)
        {
            // if user doesnt exist in the DB at all, do
            if (!Constants.ApplicationDatabase.HasInfoForUser(ea.User.SkypeHandle))
            {
                Constants.ApplicationDatabase.KnownUsers.Add(
                    new UserInformation(ea.User.SkypeHandle));
                DoAskAndAddIdentityForUser(ea.User);
            }

            var knownPubKeysForUser =
                Constants.ApplicationDatabase.GetUserInfoByName(ea.User.SkypeHandle)
                         .KnownPublicKeys;
            var userPublicKeyBytes = ea.User.IdentityPublicKey;

            // see if blocked
            if (Constants.ApplicationDatabase
                         .GetUserInfoByName(ea.User.SkypeHandle)
                         .BlockIdentityQueries.Contains(UiUtils.GetIdentityFingerprint(userPublicKeyBytes))) return;

            // if the user exists but this is a new identity, do
            if (knownPubKeysForUser.Count(x => x.SequenceEqual(userPublicKeyBytes)) == 0)
            {
                DoAskAndAddIdentityForUser(ea.User);
            }
        }
示例#2
0
 private void EncryptedChatOnUserLeft(object sender, CryptedChatPlainUserEventArgs ea)
 {
     AddChatInfoLine("Skype name: '" + ea.User.SkypeHandle + "' seems to have left the chat (NOT sure)");
 }
示例#3
0
 private void EncryptedChatOnUserJoined(object sender, CryptedChatPlainUserEventArgs ea)
 {
     AddChatInfoLine("Skype name: '" + ea.User.SkypeHandle + "' joined the chat");
 }