@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

@Matt would you be interested in a pull request to add an optional pull-stream 'through' to filter down the stream that is collected into an array in backlinks.obs.for in patch-core? :)

Or should I just implement my own observable that has that behaviour?

@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

Thanks a lot, @Matt

All useful stuff to know :D

@Gothdon voted [@happy0](@RJ09Kfs3neEZPrbpbWVDxkN92x9moe3aPusOMOc4S2I=.ed25519) > So woul
@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

So would something like this work?

api.sbot.pull.backlinks({
query: [ {$filter: {
dest: id,
value: {
content: {
type: 'chess_invite'
}
},
{
dest: id,
value: {
content: {
type: 'chess_move'
}
},
{
dest: id,
value: {
content: {
type: 'chess_game_end''
}
}

}} ]
})

(sorry, not sure how to include code blocks like you have)

To get only those 3 types of messages?

Unfortunately filtering by prefix 'chess' would hit my chess_chat type messages too (which I want to filter out).

I assume there's not a '$filterNot' ? :P

@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

Using that query style is there any way to filter by either:

  1. A list of message types (e.g. chess_invite, chess_invite_accept, chess_move, chess_game_end)
  2. Any message that is not of a given type (e.g. chess_chat.)

I'm using backlinks.obs.for for rendering my games and their updates, but I want to remove the chess_chat messages from the observable array that is returned so that they're not unnecessarily in memory and they don't cause the observable to fire (although I think I could probably achieve that one with an equality function argument) :)

@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

That worked a charm :). Thanks @Matt .

@Gothdon voted Ah yes! Good point. It uses `sbot.backlinks` under the hood (pull-stream w
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

Doesn't backlinks.obs.for return an array rather than a stream, though?

Even if my chats are not likely to get long enough for streaming / buffering while scrolling back, I'd like to be able to support long chats theoretically at least :P.

I guess I can always look at how backlinks.obs.for is implemented internally?

I'll have a look when I get back home later :).

@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

I could do with a wee hand with this whenever somebody has the time - I'm a bit stuck :P.

Can the sbot.links function here take some sort of ssb-query payload to make the stream sorted by 'claimed post time' or something?

https://github.com/Happy0/ssb-embedded-chat/blob/master/index.js#L34

@Gothdon sent a private message
@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

Oh dear... I just noticed that the ordering of the messages is messed up in the screenshot above :P.

It seems to order by my messages followed by alanz separately.

I guess I can look into that. Maybe I need to do a query using something that isn't 'sbot.links' that can let me order.

@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

Cheers for the help, guys :D

Some progress has been made:

2017-08-18-214215_1600x900_scrot-min.png

Thanks for helping me test @alanz :)

@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon
{
  "type": "chess_move",
  "ply": 23,
  "root": "%1JJv2Ch3nFE3tRzeof7yEzeRbE3EnAXXhWd9B4naUzU=.sha256",
  "orig": "g5",
  "dest": "f4",
  "pgnMove": "Bxf4",
  "fen": "r3kb1r/1pp3pp/2n1pp2/1p3b2/5B2/1P3N2/P1PPBPPP/R2Q1RK1 b kq - 0 12"
}
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon
{
  "type": "chess_move",
  "ply": 21,
  "root": "%1JJv2Ch3nFE3tRzeof7yEzeRbE3EnAXXhWd9B4naUzU=.sha256",
  "orig": "f6",
  "dest": "g5",
  "pgnMove": "Bg5",
  "fen": "r3kb1r/1pp2ppp/2n1p3/1p3bB1/5q2/1P3N2/P1PPBPPP/R2Q1RK1 b kq - 1 11"
}
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon
{
  "type": "chess_move",
  "ply": 19,
  "root": "%1JJv2Ch3nFE3tRzeof7yEzeRbE3EnAXXhWd9B4naUzU=.sha256",
  "orig": "b2",
  "dest": "f6",
  "pgnMove": "Bxf6",
  "fen": "r3kb1r/1pp2ppp/p1n1pB2/1N3b2/5q2/1P3N2/P1PPBPPP/R2Q1RK1 b kq - 0 10"
}
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon sent a private message
@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

Oh. Perhaps I spoke too soon. I found sbot.private.read() and it looks like it can give you a stream of all the user's received private messages / the injectable version from patchcore

And it looks like I might be able to filter it down further with a query to only messages applying to a given game.

Sorry for thinking aloud :P.

@Gothdon in #ssb-show-and-tell
Re: %BGqprH9Qk

@Dominic so that we can say 'a player made this chat message while the board was in this position'? Sounds reasonable.

I have a question regarding link queries and encrypted messages.

So, the usual way to link to another message is to have a 'root' field in the 'content.' However, for private messages 'content' is encrypted, so I can't just do 'sbot.links{{dest: gameId}) then filter on 'chess_chat' type messages to get all the chess messages.

I can see two options to get around this:

1) Attempt to decrypt all encrypted messages and keep some index of the ones that apply to chess games and are in one of my games when the chess app is loaded. Potentially keep an sqlite database of message IDs to gameIds and 'last seen' so that it's quicker the next time you open the app.

2) Have another message type that announces 'I sent a chat message on this gameId, here is that messages' id' then do a links query on the game ID for that message type and then fetch and decrypt the linked chat message ID.

Do you think option 2 is a waste of disk space? It'd make the app quicker to load up at least, as I wouldn't have to pre-index all the messages. Perhaps there's a privacy concern with this too because you can see how often one player is chatting to another in a game (even if you can't see the contents.)

Or is there another option I'm missing?

How do patchbay / patchwork handle messages in the 'private' tab. Do they just go through the whole feed history and look for messages that can be decrypted when you visit the tab?

@Gothdon in #nomic
Re: %biUsF4Jha

aye

does my 'aye' count even though I didn't vote? ;x (inb4 'rtfm')

@Gothdon voted [@happy0](@RJ09Kfs3neEZPrbpbWVDxkN92x9moe3aPusOMOc4S2I=.ed25519) I'd like t
@Gothdon voted ohh, i'm looking forward to see how this develops! also i loved this from
@Gothdon voted When backing up before a new install, I accidentally left the hidden files
@Gothdon in #ssb-show-and-tell

I want to add a small chat box where the two players can chat to each other in my chess app (that's integrated into patchbay.) I've started the project here: https://github.com/Happy0/ssb-embedded-chat , but only added the dependencies I think I'll need so far and nothing else :P.

Looking forward to trying the pull-scroll library for handling infinite scroll in the chatbox (probably overkill as I don't anticipate conversations will get too long :P.)

I'm going to try to make the widget re-usable. It will be configured with a 'root message id' where the chat begins from and a 'chat message type' and perhaps the 'message field'. In ssb-chess's case, it'll be the root game id and message type 'chess_chat' and field 'message'. I'm not sure whether I should also include 'participants' in the configuration so it knows who to decrypt the messages from, or whether the widget should just try to decrypt to see if it succeeds or not...

Shall update #ssb-show-and-tell when I have more :).

Feel free to offer thoughts and pull requests :P

@Gothdon voted [@zach!](@ZqH7Mctu/7DNInxuwl12ECjfrAKUX2tBLq1rOldNhg0=.ed25519) awesome! ju
@Gothdon sent a private message
@Gothdon
Re: %9qiMnG5CF

Oh wait. You were already aware of that. You're the person who commented on one of my posts saying that move validation is superfluous :P.

Glad you tried that approach out :). Look forward to trying it once I can get my hands on it

@Gothdon
Re: %9qiMnG5CF

Damn, my git-ssb hangs when I try to clone your project:

[happy0@delta projects]$ git clone ssb://%9qiMnG5CFRotqC8DDdNZwppyD7SBECCzylrTXa4huOE=.sha256 chess-thingy
Cloning into 'chess-thingy'...
Fetching blobs: 1/2

Any other way I can grab it for now? github / github / other remote git? :P

By the way, I have a little scuttlebutt chess project of my own if you're interested in trying it:

Can clone this version of patchbay https://github.com/ssbc/patchbay/pull/126 (http://www.github.com/happy0/patchbay) if you want to give the latest a try.

@Gothdon sent a private message
@Gothdon
Re: %6K6vgBN+E

aye

@Gothdon
Re: %exld1UciO

thanks! :)

@Gothdon voted mix consciously doesn't vote (to try and see what happens with 301)
@Gothdon
Re: %exld1UciO

This picture is the best :P.

Is there a video anywhere of that talk?

@Gothdon sent a private message
@Gothdon
Re: %9qiMnG5CF

Hmm... I'm having a bit of difficulty cloning this / checking it out. git seems to think it's an empty repository?

[happy0@delta thingy]$ git clone ssb://%9qiMnG5CFRotqC8DDdNZwppyD7SBECCzylrTXa4huOE=.sha256
Cloning into '%9qiMnG5CFRotqC8DDdNZwppyD7SBECCzylrTXa4huOE=.sha256'...
warning: You appear to have cloned an empty repository.
[happy0@delta thingy]$ cd %9qiMnG5CFRotqC8DDdNZwppyD7SBECCzylrTXa4huOE\=.sha256/
[happy0@delta %9qiMnG5...]$ ls
[happy0@delta %9qiMnG5...]$ git status
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)
[happy0@delta %9qiMnG5...]$ git log
fatal: your current branch 'master' does not have any commits yet
[happy0@delta %9qiMnG5...]$
[happy0@delta %9qiMnG5...]$ git checkout chessmaster
error: pathspec 'chessmaster' did not match any file(s) known to git.
[happy0@delta %9qiMnG5...]$
[happy0@delta %9qiMnG5...]$

Did I clone the wrong key or something? @angel

@Gothdon followed @angel
@Gothdon changed something in about
@Gothdon
Re: %6K6vgBN+E

och aye :thumbsup:

@Gothdon changed something in about
@Gothdon in #ssb-show-and-tell

I added the ability to go through the history of chess games (so that you can see how the current / end position was arrived on.) I only wish my design / CSS skills were better. Perhaps I'll be able to improve the look a bit over time :P

2017-08-12-214046_1600x900_scrot.png

You can either click the old moves on the right or use your keyboard's arrow keys to go back and forward to older / newer moves.

Other recent improvements:

  • Used a better board theme.
  • Ability to observe games in your network (not that anyone's actually playing... But perhaps one day :P).
  • Moved to using 'observables' (the mutant library) internally to keep the board up to date as moves are played.
  • Possible to promote to pieces that aren't a queen (in case you're feeling like being merciful on your opponent, I suppose :P.)

#ssb-chess

@Gothdon voted oh fuck, this game feels like [#enspiral](#enspiral) , but with fucking mad
@Gothdon followed @coffee
@Gothdon
Re: %6WaEhoEGT

Aye

@Gothdon
{
  "type": "chess_move",
  "ply": 6,
  "root": "%KTKEphzzpdUG7KR451ZzRyFlSTYNJGyF1qtNtzxP4LU=.sha256",
  "orig": "f8",
  "dest": "c5",
  "pgnMove": "Bc5",
  "fen": "rnbqk2r/pppp1ppp/5n2/2b1p3/4P3/1P3N2/P1PP1PPP/RNBQKB1R w KQkq - 1 4"
}
@Gothdon
{
  "type": "chess_move",
  "ply": 4,
  "root": "%KTKEphzzpdUG7KR451ZzRyFlSTYNJGyF1qtNtzxP4LU=.sha256",
  "orig": "g8",
  "dest": "f6",
  "pgnMove": "Nf6",
  "fen": "rnbqkb1r/pppp1ppp/5n2/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 2 3"
}
@Gothdon
{
  "type": "chess_move",
  "ply": 2,
  "root": "%KTKEphzzpdUG7KR451ZzRyFlSTYNJGyF1qtNtzxP4LU=.sha256",
  "orig": "e7",
  "dest": "e5",
  "pgnMove": "e5",
  "fen": "rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2"
}
@Gothdon
{
  "type": "chess_invite",
  "inviting": "@CwU3fYOuHN9Eijf6SR38jBDBrnaLAhfkAZLRsd9ljfw=.ed25519",
  "myColor": "black"
}
@Gothdon
{
  "type": "chess_move",
  "ply": 54,
  "root": "%WbzP0UxevK8j4g6CdLmgFnsjblnW0EVp/u6phVD5Y/4=.sha256",
  "orig": "a7",
  "dest": "a5",
  "pgnMove": "a5",
  "fen": "2r3k1/4ppb1/3p1npp/p7/2b1P1PP/6Q1/3KBP2/1r6 w - - 0 28"
}
@Gothdon
{
  "type": "chess_move",
  "ply": 52,
  "root": "%WbzP0UxevK8j4g6CdLmgFnsjblnW0EVp/u6phVD5Y/4=.sha256",
  "orig": "b8",
  "dest": "b1",
  "pgnMove": "Rxb1",
  "fen": "2r3k1/p3ppb1/3p1npp/8/2b1P1PP/5Q2/3KBP2/1r6 w - - 0 27"
}
@Gothdon voted this
@Gothdon voted When does the voting start, and how does it work? I am in GMT+2, will look
@Gothdon
{
  "type": "chess_move",
  "ply": 50,
  "root": "%WbzP0UxevK8j4g6CdLmgFnsjblnW0EVp/u6phVD5Y/4=.sha256",
  "orig": "b3",
  "dest": "c4",
  "pgnMove": "Bc4+",
  "fen": "1rr3k1/p3ppb1/3p1npp/8/2b1P1PP/3K1Q2/4BP2/1R6 w - - 11 26"
}
@Gothdon voted Hello, I'm a developer very passionate about computer science and all its t
@Gothdon voted [@happy0](@RJ09Kfs3neEZPrbpbWVDxkN92x9moe3aPusOMOc4S2I=.ed25519) since turn
@Gothdon voted OFFICIAL PLAYER LIST * [@soggypretzels](@3PGWnoMIY5ebs6sJjkwc7DKjxrgcrOeIU
@Gothdon changed something in about
@Gothdon voted Looks like I might be going first then. I just got git-ssb set up remotely
@Gothdon in #nomic
Re: %3cWZHeN6k

Oh wait, I just read the original post... Rule 116 means I can in fact join :D

@Gothdon voted ## welcome to [%nomic](%gW+ySFcMRjdXTf0hCEvbRrS3NcK7V6Ex0ZPTcptkJTE=.sha256
@Gothdon in #nomic
Re: %3cWZHeN6k

Can new players join once a game has started? :P

Or eh... Can that be added as a new rule once a game has started? :P

@Gothdon voted this
@Gothdon followed @Big Sooz
@Gothdon changed something in about
@Gothdon changed something in about
@Gothdon voted I will hope they all do it daily. Otherwise I feel sorry for their digestiv
@Gothdon changed something in about
@Gothdon in #newpeople
Re: %jOaihxlOD

I wonder how many people on scuttlebutt understand the significance of 'jobbie' :P

@Gothdon voted this
@Gothdon voted Hello world. Friend told me to try this out. I have listened to him
@Gothdon followed @Brown Thunder