Closed SoniEx2 closed 6 years ago
Shouldn’t these be features of the IRC client? This, and any other features like Morse encoding and whatever else we used to implement on top of IRC.
Oh my IRC client supports this, but the bridge should parse and emit CW1s for toots with CWs.
Posting with CW, on my client, would be as simple as, say, /cw "post trans, mh-" today's a dysphoria day I guess
. This would produce a toot with CW "trans, mh-" and content "today's a dysphoria day I guess".
I’m afraid I don’t understand how this is going to work and how this is going to affect since I don’t have a conforming IRC client. At the moment I suspect that this is something I wouldn’t want to enable by default. If you contribute code that contains a setting that you can switch on, then perhaps?
It gracefully falls back to plain old rot13, even clients without support won't see the hidden text by default unless they (manually) un-rot13 it.
Actually, mastodon CWs started as rot13, so this is just going full circle!
(How do you currently handle incoming CWs?)
CWs are simply printed. If I remember correctly it’s: “[content warning] NSFW text text text.”
uh, yeah, that's... bad.
While working on this I found a few issues:
_
to nicks sometimes, but I have no idea how it does that. I need to take that into account when doing word_wrap
so the CTCP doesn't cut off.The nick names are connected by the Bitlbee framework. We just send them a “hint”, the nickname we would like to get.
I can work with that, but I do need to know if there's a way to fetch the real nick?
Oh I remember now. There was also an issue with messages with timestamps on them. Why do some messages have timestamps on them? Anyway, I would like to figure those out too.
Worth noting that this CTCP was invented by soni and no client supports this out of the box.
That has already been noted in the OP (it links to something I wrote). It's still a significant quality of life improvement over auto-opening CWs.
(Some ppl just try to destroy things others build for no good reason. Adding this CTCP breaks literally nothing, and is perfectly compatible with every other existing IRC extension.)
I'm not sure what you mean by "destroy". The critical comment by @dequis? It seems like a very appropriate comment. It wasn't entirely clear to me, for example. Looking at the code, here's what I think would be cool:
no_ctcp
but it still needs setting up in mastodon_init
and mastodon_flags_t
, I think.ctcp_cw1
and be disabled by default (but see the next point).\001
and all that, just write “[content warning] NSFW ROT13 to read: grkg grkg grkg.” We could enable this if we used a different option: content_warning
with the value plain
(the default, just print it), rot13
(what I just wrote), cw1
(what @SoniEx2 proposed).develop
branch, not master
.Okay so bitlbee does a lot of word_wrap internally (to not go over IRC character limits or something) and I have to deal with that so it doesn't cut off the CTCPs. I'm just adding space for the CTCPs, and it's easier by having a newline between the CW hint and the hidden text.
The web UI puts a newline between the content warning and the hidden text. When you click "show more" it doesn't appear in front of the "show more", but rather on a new line.
Hm. I hadn't even noticed. I'll be happy to just see how it goes.
As for line wrapping in general, I've noticed that my current code must have a problem because when I post long stuff and it gets echoed back, I sometimes see that something gets cut off, so perhaps you've noticed the bug which I just ignored for a while, now.
I'll look into tweaking the other stuff, tho, thanks
what's mastodon_flags_t? I'm not sure how to add the setting.
Oops, forget that. I think this is enough: in mastodon_init you set the default value, and then you can retrieve it using set_getstr(&ic->acc->set, "content_warning")
or whatever.
If you wanted to go even further (not sure whether that's required), then you'd add a new member to mastodon_data and set it, and then you could access it from wherever md
is available.
As a user, in your control channel, use account mastodon set
to see the settings available (unless they have the hidden flag) and change them accordingly.
I can't access that from mastodon_xt_get_status? I'm not sure how I'm supposed to do this.
You should be able to access it it because it includes bitlbee.h
which includes set.h
. You didn't specify the error. My guess is that you don't have access to ic
or md
deep in mastodon_xt_get_status
? Yeah, you would have to pass something down. I'm starting to think that you should add a member to mastodon_data
and then you can pass md
down to mastodon_xt_get_status
.
I think pull request #27 handled most of the infrastructure. Thus, hide_sensitive
can now be changed to a string and thus we could have true
, false
, rot13
and cw1
as options, for example.
If you ever add default CWs for replies (aka replies that inherit the CW), the edge_case
of #28 can be used to explicitly remove them.
https://github.com/SoniEx2/CTCP-S/issues/13
(Yes, I actually use this on normal IRC. Most ppl I use this around already use rot13, anyway, so it's not a big deal for them to read it. Ofc, they never bother to send the CTCPs.)