Skip to content

Commit

Permalink
Merge pull request tinode#168 from fstn/devel
Browse files Browse the repository at this point in the history
Update data.json with anon access example
  • Loading branch information
or-else authored Oct 9, 2018
2 parents 236703f + e805ce1 commit db61b82
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tinode-db/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"passhash": "alice123",
"private": {"comment": "some comment 123"},
"public": {"fn": "Alice Johnson", "photo": "alice-64.jpg", "type": "jpg"},
"tags": ["Alice"],
"state": 1,
"status": {
"text": "DND"
Expand Down Expand Up @@ -157,12 +158,12 @@
{
"createdAt": "-117h",
"private": {"comment": "apples to oranges"},
"users": [{"name": "alice", "private": {"comment": "Apples"}},
"users": [{"name": "alice", "private": {"comment": "Apples"}},
{"name": "eve", "private": {"comment": "Alice is not what she seems"}}]
},
{
"createdAt": "-116h",
"users": [{"name": "alice", "private": {"comment": "Frank Frank Frank a-\u003ef"}},
"users": [{"name": "alice", "private": {"comment": "Frank Frank Frank a-\u003ef"}},
{"name": "frank", "private": {"comment": "Johnson f-\u003ea"}}]
},
{
Expand All @@ -171,7 +172,7 @@
},
{
"createdAt": "-114h",
"users": [{"name": "bob", "private": {"comment": "I'm banned by Dave!"}, "have": "A"},
"users": [{"name": "bob", "private": {"comment": "I'm banned by Dave!"}, "have": "A"},
{"name": "dave", "private": {"comment": "I banned Bob."}, "want": "N"}]
},
{
Expand Down Expand Up @@ -244,6 +245,14 @@
"private": {"comment": "I'm not the owner, Frank is"},
"topic": "*BF",
"user": "bob"
},
{
"createdAt": "-126h",
"name": "support",
"owner": "frank",
"tags": ["support","public"],
"public": {"fn": "Support", "photo": "support-64.jpg", "type": "jpg"},
"access": {"anon": 64, "auth": 64}
}
],
"messages": [
Expand Down
1 change: 1 addition & 0 deletions tinode-db/gendb.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func genDb(reset bool, config string, data *Data) {
Auth: types.ModeCP2P,
Anon: types.ModeNone,
},
Tags: uu.Tags,
Public: parsePublic(&uu.Public, data.datapath),
}
user.CreatedAt = getCreatedTime(uu.CreatedAt)
Expand Down
2 changes: 2 additions & 0 deletions tinode-db/makedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ User object in data.json
"text": "DND"
},
"username": "alice",
"tags": ["tag1"],
"addressBook": ["email:bob@example.com", "email:carol@example.com", "email:dave@example.com",
"email:eve@example.com","email:frank@example.com","email:george@example.com","email:tob@example.com",
"tel:17025550001", "tel:17025550002", "tel:17025550003", "tel:17025550004", "tel:17025550005",
Expand All @@ -62,6 +63,7 @@ type User struct {
State int `json:"state"`
Status interface{} `json:"status"`
AddressBook []string `json:"addressBook"`
Tags []string `json:"tags"`
}

/*
Expand Down
Binary file added tinode-db/support-64.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit db61b82

Please sign in to comment.