diff --git a/.cspell.json b/.cspell.json index 7ed8eb2..4842bfb 100644 --- a/.cspell.json +++ b/.cspell.json @@ -27,7 +27,6 @@ "ssbc", "summerfruit", "unfollow", - "unikitty", - "whoami" + "unikitty" ] } diff --git a/src/pages/models/friend.js b/src/pages/models/friend.js index 5b2ca71..fbdfa5e 100644 --- a/src/pages/models/friend.js +++ b/src/pages/models/friend.js @@ -5,7 +5,7 @@ const cooler = require('./lib/cooler') module.exports = { isFollowing: async (feedId) => { const ssb = await cooler.connect() - const { id } = await cooler.get(ssb.whoami) + const { id } = ssb const isFollowing = await cooler.get( ssb.friends.isFollowing, @@ -18,7 +18,7 @@ module.exports = { }, getRelationship: async (feedId) => { const ssb = await cooler.connect() - const { id } = await cooler.get(ssb.whoami) + const { id } = ssb if (feedId === id) { return 'this is you' diff --git a/src/pages/models/lib/cooler.js b/src/pages/models/lib/cooler.js index 5f8588a..8b3c749 100644 --- a/src/pages/models/lib/cooler.js +++ b/src/pages/models/lib/cooler.js @@ -29,7 +29,6 @@ const rawConnect = () => new Promise((resolve, reject) => { messagesByType: 'source', publish: 'async', status: 'async', - whoami: 'sync', tangle: { branch: 'async' }, query: { read: 'source' }, friends: { diff --git a/src/pages/models/meta.js b/src/pages/models/meta.js index 2e16807..d4d2b48 100644 --- a/src/pages/models/meta.js +++ b/src/pages/models/meta.js @@ -6,8 +6,8 @@ const pull = require('pull-stream') module.exports = { myFeedId: async () => { const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - return whoami.id + const { id } = ssb + return id }, get: async (msgId) => { const ssb = await cooler.connect() diff --git a/src/pages/models/post.js b/src/pages/models/post.js index efbba98..39d8e08 100644 --- a/src/pages/models/post.js +++ b/src/pages/models/post.js @@ -170,8 +170,7 @@ const post = { fromFeed: async (feedId, customOptions = {}) => { const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const options = configure({ id: feedId }, customOptions) const source = await cooler.read( @@ -200,8 +199,7 @@ const post = { mentionsMe: async (customOptions = {}) => { const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const query = [{ $filter: { @@ -222,8 +220,7 @@ const post = { fromHashtag: async (hashtag, customOptions = {}) => { const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const query = [{ $filter: { @@ -288,8 +285,7 @@ const post = { search: async ({ query }) => { const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const options = configure({ query @@ -322,8 +318,7 @@ const post = { latest: async () => { const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const options = configure({ type: 'post', @@ -368,8 +363,7 @@ const post = { throw new Error('invalid period') } - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const now = new Date() const earliest = Number(now) - (1000 * 60 * 60 * 24 * periodDict[period]) @@ -476,8 +470,7 @@ const post = { debug('thread: %s', msgId) const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const options = configure({ id: msgId }, customOptions) const rawMsg = await cooler.get(ssb.get, options) @@ -652,8 +645,7 @@ const post = { debug('get: %s', msgId) const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const options = configure({ id: msgId }, customOptions) const rawMsg = await cooler.get(ssb.get, options) @@ -709,8 +701,7 @@ const post = { inbox: async (customOptions = {}) => { const ssb = await cooler.connect() - const whoami = await cooler.get(ssb.whoami) - const myFeedId = whoami.id + const myFeedId = ssb.id const options = configure({ type: 'post'