~reedwade/wee-matter-devel

wee-matter: Add appropriate notify_levels on messages v1 APPLIED

~midgard: 1
 Add appropriate notify_levels on messages

 2 files changed, 12 insertions(+), 2 deletions(-)
Quoting Eddie Barraco
Next
Eddie Barraco
Can you tell me if the partial apply is enough to you ?

To git.sr.ht:~reedwade/wee-matter
   74e188e..c5e3bd4  c5e3bd4 -> master


Quoting ~midgard (2020-11-16 10:21:14)
Next
Eddie Barraco
Okay my bad, you used in fact the same mapping as me.
I remember that direct and group don't have a team id. That's why I
use this information to discriminate both cases.

Okay in fact your notify tags seems good to me. I'll not merge the
changes on the localvar_set_type as this will not change anything
functionnaly.
Quoting Eddie Barraco (2020-11-18 11:06:38)
Next
Eddie Barraco
Nice catch, done !

To git.sr.ht:~reedwade/wee-matter
   c5e3bd4..0fee936  0fee936 -> master
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~reedwade/wee-matter-devel/patches/15034/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH wee-matter] Add appropriate notify_levels on messages Export this patch

From: Midgard <2885-Midgard@users.noreply.framagit.org>

---
 wee_matter/post.py | 7 +++++++
 wee_matter/room.py | 7 +++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/wee_matter/post.py b/wee_matter/post.py
index e798f12..de625ee 100644
--- a/wee_matter/post.py
+++ b/wee_matter/post.py
@@ -166,6 +166,13 @@ def write_reply_message_lines(buffer, post):

def write_message_lines(buffer, post):
    tags = "post_id_%s" % post.id

    channel_type = weechat.buffer_get_string(buffer, "localvar_type")
    if channel_type == "channel":
        tags += ",notify_message"
    else:
        tags += ",notify_private"

    if post.reactions:
        tags += ",reactions"
        weechat.prnt_date_tags(
diff --git a/wee_matter/room.py b/wee_matter/room.py
index b36eb72..83d888c 100644
--- a/wee_matter/room.py
+++ b/wee_matter/room.py
@@ -184,10 +184,14 @@ def create_room_from_channel_data(channel_data, server):
    weechat.buffer_set(buffer, "highlight_words", "@{},{},@here".format(server.user.username, server.user.username))
    weechat.buffer_set(buffer, "localvar_set_nick", server.user.username)

    if channel_data["type"] in ("O", "P"):
        weechat.buffer_set(buffer, "localvar_set_type", "channel")
    else:
        weechat.buffer_set(buffer, "localvar_set_type", "private")

    if channel_data["team_id"]:
        team = server.teams[channel_data["team_id"]]

        weechat.buffer_set(buffer, "localvar_set_type", "channel")
        weechat.buffer_set(buffer, "localvar_set_server", team.display_name)

        parent_number = weechat.buffer_get_integer(team.buffer, "number")
@@ -195,7 +199,6 @@ def create_room_from_channel_data(channel_data, server):

        team.buffers.append(buffer)
    else:
        weechat.buffer_set(buffer, "localvar_set_type", "private")
        weechat.buffer_set(buffer, "localvar_set_server", server.name)

        parent_number = weechat.buffer_get_integer(server.buffer, "number")
-- 
2.26.2
Eddie Barraco
~midgard <midgard@git.sr.ht> wrote:
Eddie Barraco
~midgard <midgard@git.sr.ht> wrote: