by esotericn · 7y ago · 0 comments
Personally I don't think IRC will ever be replaced. Well, it will, but it'll happen when my generation dies and gets fully replaced with the New Shiny.
I _hope_ that some sort of real, proper standard, that doesn't endlessly reinvent itself, that isn't subject to some for-profit bollocks, that on a very basic level, has like, a standard, has _clients_ (not just one wanky proprietary web frontend) that just sits and gets the job done like TCP, comes out of all of this.
Meanwhile, I'm fairly sure IRC will still be there in another fifteen.
Hell, at this point, IRC has been a constant in my life for longer than everything other than family. It actually feels like a friend. A portal to another quirky world, just as it did all those years ago.
I think it's almost two decades now since I first logged in. My my. The years are short, indeed.
Ideally you should be able to build a Matrix client in something like a Python REPL and like 20 lines of code with an `input` loop at the end. I don't know if that's the case at the moment.
USERNAME='@whoever:matrix.org'; SERVER='https://matrix.org'; ROOM='#test:matrix.org'
read -s -p "Password for $USERNAME:" PASSWORD
TOKEN=`curl -X POST $SERVER/_matrix/client/r0/login --data "{ 'type': 'm.login.password', 'login': '$USERNAME', 'password': '$PASSWORD' }" | jq .access_token`
ROOM_ID=`curl $SERVER/_matrix/client/r0/directory/room/$ROOM | jq .room_id`; curl "$SERVER/_matrix/client/r0/join/$ROOM_ID?access_token=$TOKEN"
(while true; do SYNC=`curl -s $SERVER/_matrix/client/r0/sync?access_token=$TOKEN&timeout=30000&since=$SINCE`
echo $SYNC | jq ".rooms.join.$ROOM_ID.timeline"
SINCE=`echo $SYNC | jq .next_batch`; done) &
while true; do read -p "<$USERNAME> " INPUT; `curl -s -X POST $SERVER/_matrix/client/r0/rooms/$ROOM_ID/m.room.message?access_token=$TOKEN --data "{ 'body': '$INPUT', 'msgtype': 'm.text'}"`; done
Spread out a bit more with comments: # set your matrix ID & server URL, and the room you want to chat in:
USERNAME='@whoever:matrix.org'
SERVER='https://matrix.org'
ROOM='#test:matrix.org'
# prompt for a password; log in and grab an access_token
read -s -p "Password for $USERNAME:" PASSWORD
TOKEN=`curl -X POST $SERVER/_matrix/client/r0/login --data "{ 'type': 'm.login.password', 'login': '$USERNAME', 'password': '$PASSWORD' }" | jq .access_token`
# resolve the room alias (#test:matrix.org) to a room ID (!vfFxDRtZSSdspfTSEr:matrix.org)
ROOM_ID=`curl $SERVER/_matrix/client/r0/directory/room/$ROOM | jq .room_id`
# check that you're joined to the room (redundant if you know you're already there)
curl "$SERVER/_matrix/client/r0/join/$ROOM_ID?access_token=$TOKEN"
# set a background loop running to receive messages, and use jq to filter out the
# messages for the room you care about from the sync response. For now we print them
# as JSON pretty-printed by jq, but that's not too bad.
(while true;
do SYNC=`curl -s $SERVER/_matrix/client/r0/sync?access_token=$TOKEN&timeout=30000&since=$SINCE`
echo $SYNC | jq ".rooms.join.$ROOM_ID.timeline"
SINCE=`echo $SYNC | jq .next_batch`
done) &
# set a foreground loop running to prompt for your own messages and send them
# into the room as plaintext.
while true;
do read -p "<$USERNAME> " INPUT;
`curl -s -X POST $SERVER/_matrix/client/r0/rooms/$ROOM_ID/m.room.message?access_token=$TOKEN --data "{ 'body': '$INPUT', 'msgtype': 'm.text'}"`
done
If I have time I'll actually try running & debugging this to be usable and edit the post (but got to run into a meeting now :( ).Needless to say, this'd be much prettier on Python - and you'd prolly want to use a nice SDK like https://github.com/poljar/matrix-nio (see https://matrix.org/blog/2019/07/03/usage-of-matrix-nio/) so you get things like E2E Encryption for free. But doing it in plain bash hopefully gives more of an idea.
I think it’s important to not be “using a library” since the test case is hopefully that the protocol is easy enough to get something barebones with even super baseline tools. Your bash script obviously matches this requirement
My reference here is the excellent Haskell Wiki “Build tour own IRC bot”. Really captures the simplicity of the protocol
> I used bashtrix for about 4 hours this morning. Why, you ask? I didn't have the bandwidth, latency or reliability to use Riot. I ended up using bashtrix on one of my servers through mosh...
> Could have done with scroll back (the screen fills up with 'null' and '[]' – the latter, I started to recognise as marking read receipts and/or perhaps presence) but shrank the font size down and made the most of it :p. Worked Rather well considering
This seems to indicate it's missing a register step, and then it fails to be as simple as IRC where you just set nickname and connect to a server. Sometimes the server asks you to identify yourself, but that's up to the server, not the protocol.
That said, Matrix also supports guest accounts (which are quite locked down to prevent abuse, but would work for this example) - so the /login request could be replaced by calling /register with type=guest which would then do what you want.
edit: it would look something like this (7 lines now!):
SERVER='https://matrix.org'; ROOM='#test:matrix.org'
TOKEN=`curl -X POST $SERVER/_matrix/client/r0/register --data "{ 'kind': 'guest' }" | jq .access_token`
ROOM_ID=`curl $SERVER/_matrix/client/r0/directory/room/$ROOM | jq .room_id`; curl "$SERVER/_matrix/client/r0/join/$ROOM_ID?access_token=$TOKEN"
(while true; do SYNC=`curl -s $SERVER/_matrix/client/r0/sync?access_token=$TOKEN&timeout=30000&since=$SINCE`
echo $SYNC | jq ".rooms.join.$ROOM_ID.timeline"
SINCE=`echo $SYNC | jq .next_batch`; done) &
while true; do read -p "> " INPUT; `curl -s -X POST $SERVER/_matrix/client/r0/rooms/$ROOM_ID/m.room.message?access_token=$TOKEN --data "{ 'body': '$INPUT', 'msgtype': 'm.text'}"`; doneDo take a look at https://gitlab.com/darnir/matrix-shell-suite
It's a basic matrix client written in pure POSIX sh.
I do prefer my chat client to not be a part of my browser. That way I can close my browser, start my browser and chat client on login ie from i3/sway etc. A tab in a browser runs the risk of getting closed.
I love using weechat (weechat.org) and have used it for decades. The Matrix plugin for Weechat is really well done https://github.com/poljar/weechat-matrix
Other people who want to use Riot can if they want at the end of the day I think matrix is probably the best option as it will cater for many people's needs.
But that should also be an option too. Matrix could be great to integrate with for both private and public web communities , and that would incentivize people to create more homeservers. There is currently a lack of such solutions for communities and matrix could fill that gap. It's just sad that we have to end up sending people to sign up to discord .
It was less than 500MB of plaintext irssi logs.
It's rock solid in what it does, I have zero doubt about that or your 15 year claim. But even if the protocol works, if the user base isn't being added to it will die eventually.
If you are really referring to phone notifications, well, you can use an IRC client on your phone, then you would get notifications on your phone. I use irssi even on my Android phone.
Let us not forget that there is the other side of the story: many people report that they have been enjoying life more without those phone notifications.
I love IRC. I have been using IRC ever since I was 11. It made me a more technical person. I find that IRC is not that easily accessible to the majority, which is a good thing, because of this, the conversations tend to be of higher quality, and technical in most channels. I would also like to add that IRC is the reason I understand English, and a zillion other things. :)
With phone notifications, you not only need to work for things that happened while not connected, it's bad form to require a permanent connection on android and you can't do it at all on an iphone.
I don't miss anything.
I have that with a bouncer (znc) and a plugin. I've not used it, but it is my understanding that IRCCloud does this too. Problem is that there aren't many easily usable options for this apart from IRCCloud and even IRCCloud itself isn't all that well marketed.
Always seemed kind of weird how while IRC is full with FOSS people who are willing to use their time on various projects they're not getting paid for, most of whom also seem to worry about IRC dying out, nobody is really doing anything about it. A lot of the conveniences we miss could mostly be solved by making modern clients that are actually good.
I think it also dampens the same for traditional paid software in a lot of areas, incidentally.
It works very well now, and the Android client is pretty great too, but there are still some gaps. Mainly, the surrounding ecosystem is quite sparse, e.g.: - There is basically only a single web client for it (node-based, which is a con from my perspective) - There are only a handful of semi-functional log searching/browsing utilities around
Which is, sadly, a lost cause. We had a simple, reliable, open, decentralized base that simply did not adopt to the needs of a changing userbase of the internet enough. Non-technical users have expectations that are incompatible with the text only format and they prefer platforms that feel more like their other social media tools. Technical users don't fix that and get riled up about nonsense instead, like non-TLS connections and other points that were addressed a decade ago, alongside people that just prefer a more decentralized system.
It feels like xkcd #927 is also relevant [0]. The open source world in chat/social platforms often looks like Googlers looking for a promotion instead of addressing real needs and most efforts seem to be drowning in irrelevance. Even technically sensible projects like Matrix, who's going to use that? Not the instagram crowd that's for sure, heck, many technically inclined people cannot be bothered with IRC when the alternative is convenient. I'd be really surprised if we see a widely adopted open messenger in 10 years, it's more likely that people just settle on a new random walled garden every 3-5 years.
I noticed myself using IRC less for this reason. I'd always run weechat on servers so I had the history but never thought to look for notifications these days.
I signed up for IRCCloud and it's been nothing but excellent so far. I can even connect weechat to it like a BNC.
My freenode nick was registered in 2005, and I know that's the "new" registration since I accidentally confused the nickserv RELEASE and DROP commands once, and had to re-register the nick I had just mistakenly unregistered. It had a few years of history prior to 2005, but I don't know the details anymore.
And prior to Freenode, I was on a few other networks going back to '94 or so. But moving networks meant it wasn't a "constant" in terms of being the same environment, just the same interface.
We're not the only ones who feel that IRC will be around until we're gone... https://xkcd.com/1782/