kensanata / bitlbee-mastodon

A Mastodon plugin for Bitlbee
https://alexschroeder.ch/software/Bitlbee_Mastodon
GNU General Public License v2.0
30 stars 7 forks source link

support private messages #17

Closed anarcat closed 6 years ago

anarcat commented 6 years ago

i know that private messages are explicitly unsupported in mastodon-lib.c, but it would still be an interesting feature to add.. What's missing to get that working? would this be a separate post command? or a server-side setting?

anarcat commented 6 years ago

in particular, i was surprised to see that the bitlbee module doesn't respect the server-side settings. in other words, setting your posts to be "private by default" on the mastodon server doesn't affect bitlbee-generated messages... which means the bitlbee client explicitly sets messages to be public.

kensanata commented 6 years ago

Well, one might think that default visibility is a server side setting but in fact it is not. The API is state-less in this respect. It is up to us to have such a default and to respect it. The API says that we need to pass along a visibility parameter. See mastodon_post_status already does the switching for direct messages, but doesn't know about private and unlisted. Thus, instead of accepting a gboolean direct we should change that to a mastodon_visibility_t visibility and do the right thing.

As for the user interface, perhaps it should be a setting so that we can change the default. We need to create that in mastodon_init. The user can set this and when they save, that's their default. And then we use this when posting. This is step 1.

The rest is bonus material: a command to show the current setting without having to switch to &bitlbee and having to type account mastodon set visibility. A command to set this temporarily. Add a second, hidden setting with the current visibility setting, initialize this from the default, and use the hidden setting instead. The benefit is that changing the hidden settting and saving your account info would not overwrite the real default. But all of this is step 2 and requires implementing step 1, first.

Will you look into it?

anarcat commented 6 years ago

Will you look into it?

At this point, no: lack of time. :) But this might itch hard enough that I might do it in the future, so thanks a lot for clarifying the way for now!