Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

purple: add defer_joins, use_matrix_alias and name_with_tag options #125

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

eeeeeta
Copy link

@eeeeeta eeeeeta commented Apr 4, 2019

(Most of these changes are aimed at making matrix not a pain to use)

  • The defer_joins option on prpl accounts waits for users to be added
    to a prpl conversation before adding the bitlbee user, in the hope
    of being able to get some chat name/alias metadata before doing so.
  • (To that end, the name hint for rooms is now updated when users are
    added.)
  • The name_with_tag options prefixes the account tag to the name hint
    for prpl accounts, in order to namespace prpl channels somewhat.
  • The use_matrix_alias option is specialized for the purple-matrix
    plugin, and makes the name hint use the matrix_alias data item
    of the prpl conversation, instead of the title.
  • Also, MAX_NICK_LENGTH was increased to 80 (because matrix room names are long).

(Most of these changes are aimed at making matrix not a pain to use)
- The `defer_joins` option on prpl accounts waits for users to be added
  to a prpl conversation before adding the bitlbee user, in the hope
  of being able to get some chat name/alias metadata before doing so.
- (To that end, the name hint for rooms is now updated when users are
  added.)
- The `name_with_tag` options prefixes the account tag to the name hint
  for prpl accounts, in order to namespace prpl channels somewhat.
- The `use_matrix_alias` option is specialized for the purple-matrix
  plugin, and makes the name hint use the `matrix_alias` data item
  of the prpl conversation, instead of the title.
Copy link
Member

@dequis dequis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fancy stuff. Not entirely sure about having a whole bunch of extra settings, but it's probably the right thing to do, there's no polite way to change channel name defaults.

Having help strings for these would be nice btw.

protocols/purple/purple.c Outdated Show resolved Hide resolved
protocols/purple/purple.c Outdated Show resolved Hide resolved
protocols/purple/purple.c Outdated Show resolved Hide resolved
protocols/purple/purple.c Outdated Show resolved Hide resolved
protocols/purple/purple.c Outdated Show resolved Hide resolved
@@ -1171,7 +1205,7 @@ static void handle_conv_msg(PurpleConversation *conv, const char *who, const cha
{
struct im_connection *ic = purple_ic_by_pa(conv->account);
struct groupchat *gc = conv->ui_data;
char *message = g_strdup(message_);
char *message = purple_unescape_html(message_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: This seems unlikely to be desirable for all prpls. I think there's a prpl flag to mark it as sending html or not?

@@ -1133,7 +1158,12 @@ void prplcb_conv_new(PurpleConversation *conv)
/* libpurple brokenness: Whatever. Show that we join right away,
there's no clear "This is you!" signaling in _add_users so
don't even try. */
imcb_chat_add_buddy(gc, gc->ic->acc->user);
if (!set_getbool(&(ic->acc->set), "defer_joins")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Considering the comment above, I wonder if this should be default behavior, because yeah, this ugly behavior affects quite a few prpls.

It's mostly a question of whether the defer point is always reached reliably - would, say, a newly created channel with no other members skip the add users call? Some weird prpl that just don't do it, and add them with delay?

@@ -1154,6 +1184,10 @@ void prplcb_conv_add_users(PurpleConversation *conv, GList *cbuddies, gboolean n

imcb_chat_add_buddy(gc, pcb->name);
}
purple_hint_chat_names(gc, conv);
if (!gc->joined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self, recheck the meaning of this one.

protocols/purple/purple.c Outdated Show resolved Hide resolved
protocols/purple/purple.c Outdated Show resolved Hide resolved
protocols/purple/purple.c Outdated Show resolved Hide resolved
@Thaodan
Copy link
Contributor

Thaodan commented Jun 15, 2019

Is the use_matrix_alias for using something similar to the telegram username?
If yes it could have some use in telegram too.

@eeeeeta
Copy link
Author

eeeeeta commented Jun 15, 2019 via email

@Thaodan
Copy link
Contributor

Thaodan commented Dec 25, 2021

What's missing in this to be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants