Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #618 from 3box/release/1.12.0
Browse files Browse the repository at this point in the history
Release/1.12.0
  • Loading branch information
oed authored Oct 4, 2019
2 parents cb2c477 + e302326 commit 46f2a2e
Show file tree
Hide file tree
Showing 13 changed files with 2,063 additions and 1,246 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ Please use **box.openSpace** to get the instance of this class
| Name | Type | Description |
| --- | --- | --- |
| syncDone | <code>Promise</code> | A promise that is resolved when the box is synced |
| syncDone | <code>Promise</code> | A promise that is resolved when the space data is synced |
<a name="Space+DID"></a>
Expand All @@ -880,6 +880,8 @@ Join a thread. Use this to start receiving updates from, and to post in threads
| opts.firstModerator | <code>String</code> | DID of first moderator of a thread, by default, user is first moderator |
| opts.members | <code>Boolean</code> | join a members only thread, which only members can post in, defaults to open thread |
| opts.noAutoSub | <code>Boolean</code> | Disable auto subscription to the thread when posting to it (default false) |
| opts.ghost | <code>Boolean</code> | Enable ephemeral messaging via Ghost Thread |
| opts.ghostBacklogLimit | <code>Number</code> | The number of posts to maintain in the ghost backlog |
<a name="Space+joinThreadByAddress"></a>
Expand Down
8 changes: 8 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release Notes

## v1.12.0 - 2019-10-04
This release contains a feature called Ghost Threads. These threads are not persisted by in any way except in memory between users. Ghost Threads uses ipfs pubsub to send messages between peers, so in addition we have added a websocket signaling server to make peers discover each other easier. Ghost Threads includes a backlog for users that just joined, this is sent by already connected users that have a copy of recent messages.

---
* feat: added Ghost Threads
* feat: enabled websocket signaling server
* fix: small docs and dependency improvements

## v1.11.0 - 2019-09-24
* feat: 3box instance can now be created with an instance of the IdentityWallet
* feat: smarter data syncing logic
Expand Down
2 changes: 2 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ <h3> Threads: </h3>
<input type="text" id="threadfirstModerator" placeholder="Thread Root Moderator"></br>
<span > Members Only Thread </span>
<input type="radio" name="members" id='members' value="true"> </br>
<span > Ghost ? </span>
<input type="radio" name="ghostCheck" id='ghostCheck' value="true"> </br>
<button id="joinThread" type="button" class="btn btn btn-primary" >Join thread</button> </br></br>

<div id="threadModeration" style="display: none;">
Expand Down
36 changes: 26 additions & 10 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,26 @@ bopen.addEventListener('click', event => {
const name = threadName.value
const firstModerator = threadfirstModerator.value
const membersBool = members.checked
const ghostBool = ghostCheck.checked
console.log('ghost?', ghostBool);
posts.style.display = 'block'
threadModeration.style.display = 'block'
if (members.checked) threadMembers.style.display = 'block'
box.spaces[window.currentSpace].joinThread(name, {firstModerator, members: membersBool}).then(thread => {
if (ghostCheck.checked) {
addThreadMod.disabled = true
}
box.spaces[window.currentSpace].joinThread(name, {firstModerator, members: membersBool, ghost: ghostBool}).then(thread => {
window.currentThread = thread
thread.onUpdate(() => {
updateThreadData()
})
thread.onNewCapabilities(() => {
updateThreadCapabilities()
})
updateThreadData()
updateThreadCapabilities()
if (window.currentThread._room == undefined) {
updateThreadData()
updateThreadCapabilities()
}
}).catch(updateThreadError)
})

Expand Down Expand Up @@ -153,19 +160,28 @@ bopen.addEventListener('click', event => {

const updateThreadCapabilities = () => {
threadMemberList.innerHTML = ''
if (window.currentThread._members) {
// if else statement cause ghost thread can't list moderators
if (window.currentThread._peerId) {
window.currentThread.listMembers().then(members => {
members.map(member => {
threadMemberList.innerHTML += member + '<br />'
})
})
}
threadModeratorList.innerHTML = ''
window.currentThread.listModerators().then(moderators => {
moderators.map(moderator => {
threadModeratorList.innerHTML += moderator + '<br />'
} else {
if (window.currentThread._members) {
window.currentThread.listMembers().then(members => {
members.map(member => {
threadMemberList.innerHTML += member + '<br />'
})
})
}
threadModeratorList.innerHTML = ''
window.currentThread.listModerators().then(moderators => {
moderators.map(moderator => {
threadModeratorList.innerHTML += moderator + '<br />'
})
})
})
}
}

postThread.addEventListener('click', () => {
Expand Down
Loading

0 comments on commit 46f2a2e

Please sign in to comment.