jaros1 / Money-Network

Demo with complementary and alternative money. Implemented in ZeroNet and AngularJS. Focus on privacy, encryption, max data in client and min data on ZeroNet. Work in progress.
GNU General Public License v2.0
4 stars 4 forks source link

Fixed contacts_query 11 #239

Closed jaros1 closed 6 years ago

jaros1 commented 6 years ago

Error message Search for new unknown contacts failed. No contacts were found

Maybe an not merger-site query:

SELECT
  users.user_seq,
  users.pubkey,
  users.avatar                                                                      AS users_avatar,
  data_json.directory,
  substr(data_json.directory, 7)                                                    AS auth_address,
  data_json.json_id                                                                 AS data_json_id,
  content_json.json_id                                                              AS content_json_id,
  keyvalue.value                                                                    AS cert_user_id,
  (SELECT substr(files.filename, 8)
   FROM files, json AS avatar_json
   WHERE files.filename LIKE 'avatar%' AND avatar_json.json_id = files.json_id AND
         avatar_json.directory = data_json.directory)                               AS files_avatar,
  (SELECT status.timestamp
   FROM json AS status_json, status AS status
   WHERE status_json.directory = data_json.directory AND status_json.file_name = 'status.json' AND
         status.json_id = status_json.json_id AND status.user_seq = users.user_seq) AS timestamp
FROM users, json AS data_json, json AS content_json, keyvalue AS keyvalue
WHERE data_json.json_id = users.json_id
      AND substr(data_json.directory, 7) IN
          ('1DV8axrE8btMBwhCr94qTg29Vy5neqqLGm', '181uraAmCiADt2PgPbj6Yd9sJfFVxKUjVj', '1MirY1KnJK3MKzgZiyZZM8FkyzHRJgmMh8', '184oSpwPUHeXpTqJ8EXkMN3i9uMhjTJ5nC', '195z3T7ZBNo5Z3aYFzaokb4HZMJhnp14Bd', '1BNYnjf1SjJeSKenxKXfcsuWYiL27rXNak')
      AND content_json.directory = data_json.directory AND content_json.file_name = 'content.json' AND
      keyvalue.json_id = content_json.json_id AND keyvalue.key = 'cert_user_id';
jaros1 commented 6 years ago

Fixed problem in contacts query 11. Maybe also a problem in query 12:

            // ready for emoji lookup in like table
            query =
                "select substr(like_json.directory, 7) as auth_address, users.pubkey, like.emoji, like.count " +
                "from like, json as like_json, json as data_json, users " +
                "where like.timestamp = " + timestamp + " " +
                "and like.auth = '" + auth + "' " +
                "and like_json.json_id = like.json_id " +
                "and data_json.directory = like_json.directory " +
                "and data_json.file_name = 'data.json' " +
                "and users.json_id = data_json.json_id " +
                "and users.user_seq = like.user_seq" ;