Code Monkey home page Code Monkey logo

Comments (11)

poljar avatar poljar commented on July 26, 2024 2

I was actually intending to use this with autosort to begin with. the problem I have noticed is that when using matrix, it is fairly common for me to have ~30-50 channels, from all different protocols and servers, all sorted under the same server buffer. this can create some confusion and inefficiency due to the nature of federated networks, in that channels can have the same name if on different servers. so there becomes no way to tell them apart without entering the buffer.

There is a separate buffer for each server, they are merged by default just like they are for the IRC plugin. You can have channels with the same name on different IRC servers as well.

There is also a setting matrix.look.server_buffer that mimics the behavior of the irc setting of the same name. That is you can set the server buffers to be merged, merged with the core buffer or to be independent of each other.

it would be nice to be able to split the single server buffer we have now into multiple each with a subset of the rooms sorted under them, so as to sort the buffers into different categories like work, home, etc.. without having to establish and maintain multiple matrix server connections and multiple matrix accounts on a homeserver.

If we split out a single server buffer what would each of them print out? Duplicate the server info? Only print on one of them? Something else?

I envision a workflow similar to the following, position / name of arguments could be changed of course.

/matrix add pseudo_server [homeserver_name] [new_pseudo_server]

with the effect that a new server buffer is created with a similar name to homeserver_pseudo

I believe moving rooms between these would fit nicely under /room. i.e:

/room move [pseudo_server]

would move the room from being a child of the main server buffer to being a child of the pseudo server buffer.

a call to /save would then make this persistent

It seems like you would like something along the line of buffer groups, and you would like to be able to create arbitrary groups and put buffers into those groups.

I don't think a new pseudo server buffer that isn't used for anything besides hierarchical ordering of buffers is a good idea. The buffer group should just be an UI element in the buflist bar.

Besides I don't see how this is protocol specific, this should be part of the core of weechat:

  • /buffer add group <group-name>
  • /buffer move-to-group <buffer> <group>

And finally to make this permanent:

  • /layout store

the main idea is to split the physical server connection into sortable named logical connections to decrease confusion caused by federated naming. I understand there is a good deal of back end required to do something like this, but similar already exists in plugins like wee-slack where different slack groups are given different server buffers.

As far as I can tell the Slack script opens a new connection for every Slack team/group. It also requires a new Slack token for each team. A Slack team is equivalent to a IRC/matrix server here, and we already have a server buffer for every matrix server. There is no arbitrary buffer group creation in the slack script either.

The feature seems to be a very good idea, but putting it into a protocol script doesn't seem to fit. I'm sure people would like to use such a feature with IRC or Slack channels as well. The proper place for this feature seems to be:

  • Weechat core, /buffercommand, to add arbitrary buffer groups.
  • The buflist plugin, to show the groups and buffers in a hierarchical order.
  • Weechat core, /layout command, to store and restore buffer groups.

from weechat-matrix.

poljar avatar poljar commented on July 26, 2024 1

If it's sorting that you're after, you can already set arbitrary buffer variables/properties with /buffer set you can save/restore them with the buffer_autoset.py script.

The autosort script can be configured to use those properties/variables.

We already expose a bunch of additional localvars for buffers (e.g. the domain name, full room_id). You can check those with /buffer localvar.

If you have some additional suggestions to add to the localvars those would be easy to add.

from weechat-matrix.

dkasak avatar dkasak commented on July 26, 2024

What exactly do you mean by groups of channels? Do you mean you want your buffers to be automatically sorted by certain criteria, such as by protocol, server, name and so on? For this, you can use the autosort.py weechat script:

/script install autosort.py
/help autosort

from weechat-matrix.

zetorian avatar zetorian commented on July 26, 2024

I was actually intending to use this with autosort to begin with. the problem I have noticed is that when using matrix, it is fairly common for me to have ~30-50 channels, from all different protocols and servers, all sorted under the same server buffer. this can create some confusion and inefficiency due to the nature of federated networks, in that channels can have the same name if on different servers. so there becomes no way to tell them apart without entering the buffer.

it would be nice to be able to split the single server buffer we have now into multiple each with a subset of the rooms sorted under them, so as to sort the buffers into different categories like work, home, etc.. without having to establish and maintain multiple matrix server connections and multiple matrix accounts on a homeserver.

I envision a workflow similar to the following, position / name of arguments could be changed of course.

/matrix add pseudo_server [homeserver_name] [new_pseudo_server]

with the effect that a new server buffer is created with a similar name to homeserver_pseudo

I believe moving rooms between these would fit nicely under /room. i.e:

/room move [pseudo_server]

would move the room from being a child of the main server buffer to being a child of the pseudo server buffer.

a call to /save would then make this persistent

the main idea is to split the physical server connection into sortable named logical connections to decrease confusion caused by federated naming. I understand there is a good deal of back end required to do something like this, but similar already exists in plugins like wee-slack where different slack groups are given different server buffers.

from weechat-matrix.

dkasak avatar dkasak commented on July 26, 2024

What I was suggesting above was that perhaps, as an intermediate solution, there is a way to sort the buffers using autosort in a way that @zetorian would like, so that the preferred grouping is implicit in the sort order. This would achieve what he wants, sans the buffer group names and visual indication of the hierarchy (such as indentation under the buffer group name), which is functionality that could be added to weechat core later on.

Whether this is achievable depends on the exact grouping criteria, of course. Is it completely arbitrary, such that it could only be achieved by manual creation of groups/pseudoservers and manual assignment of each buffer to a group/pseudoserver, or is there a general principle that could be handled with autosort? Perhaps there are some missing pieces of information that weechat-matrix could reasonably expose through additional buffer localvars?

from weechat-matrix.

zetorian avatar zetorian commented on July 26, 2024

I agree wholeheartedly that this should be a part of weechat core, but as development for that is fairly stagnant at the moment, I don't have high hopes.

as for the autosort method, I have done quite a bit to tweak rules and regex to get it to work, and it does, until a new buffer is added.

I wonder if a good spot for this would be in autosort itself? or maybe a completely independent script?

from weechat-matrix.

poljar avatar poljar commented on July 26, 2024

This seems to be already possible https://github.com/weechat/weechat/wiki/buflist#wiretree-example.

from weechat-matrix.

demlak avatar demlak commented on July 26, 2024

hey.. i just tried to sort by channel names.. but /buffer localvar does not show the trivial names but only the room IDs.. so it's impossible to autosort in a usable way? or do i overlook something?

So variable for trivial room-name and community-name would be nice for human-readable sort-orders =)

from weechat-matrix.

poljar avatar poljar commented on July 26, 2024

What do you mean by trivial name? If you mean the thing that's shown in the buflist that's in the short_name variable, note that's not a localvar.

from weechat-matrix.

demlak avatar demlak commented on July 26, 2024

it seems, that this is what i was talking about.. since i'm new to autosort and new to matrix i just stuck on this..
i wanted to sort the order of all buffers by names i can see... and the icing on the cake would be sorting by groups/communities

edit: got the first part.. /autosort rules add $if:${script_name}==matrix?${buffer.short_name}} and then reorder rules set to use this rule before ${buffer.full_name}

from weechat-matrix.

myii avatar myii commented on July 26, 2024

it seems, that this is what i was talking about.. since i'm new to autosort and new to matrix i just stuck on this..
i wanted to sort the order of all buffers by names i can see... and the icing on the cake would be sorting by groups/communities

edit: got the first part.. /autosort rules add $if:${script_name}==matrix?${buffer.short_name}} and then reorder rules set to use this rule before ${buffer.full_name}

Thanks for sharing this, @demlak -- got me most of the way there. There's a little typo in what you provided that I had to fix:

-/autosort rules add $if:${script_name}==matrix?${buffer.short_name}}
+/autosort rules add ${if:${script_name}==matrix?${buffer.short_name}}

Also, I had to move the rule higher up, since ${server} was taking precedence in my setup (checked with /autosort debug).

from weechat-matrix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.