42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

Ensure prefixcontext/suffixcontent shown for all lines in a multi-line message #483

Closed hloeung closed 1 year ago

hloeung commented 2 years ago

With the new no splitting multi-line messages in PR #482, multi-line messages are displayed as:

|20:09 <hloeung> Test One
|20:09 <hloeung> Test Two
|20:09 <hloeung> Test Three [c9ouoenfkprajc6o96zdp9z87y]
|20:16 <hloeung> Test One
|20:16 <hloeung> Test Two
|20:16 <hloeung> Test Three (re @hloeung: Test One Test Two Test …) [↪c9ouoenfkprajc6o96zdp9z87y,ak8gwopx4jnqbjf5ipnrtifyrc]

Unfortunately, it means using tools such as grepping won't show all the lines as part of the message. This fixes that:

|20:48 <hloeung> Test One [↪c9ouoenfkprajc6o96zdp9z87y,6wfxbuie3ty8x84ya4fpj8cabr]
|20:48 <hloeung> Test Two [↪c9ouoenfkprajc6o96zdp9z87y,6wfxbuie3ty8x84ya4fpj8cabr]
|20:48 <hloeung> Test Three (re @hloeung: Test One Test Two Test …) [↪c9ouoenfkprajc6o96zdp9z87y,6wfxbuie3ty8x84ya4fpj8cabr]
|20:50 <hloeung> Test One [002->001]
|20:50 <hloeung> Test Two [003->001]
|20:50 <hloeung> Test Three (re @hloeung: Test One Test Two Test …) [004->001]
|20:51 <hloeung> Test One [005->001]
|20:51 <hloeung> Test Two [006->001]
|20:51 <hloeung> Test Three (re @hloeung: Test One Test Two Test …) [007->001]
|20:51 <hloeung> Test [008]
|20:51 <hloeung> @@008 test [↪008]
|20:51 <hloeung> [↪c9ouoenfkprajc6o96zdp9z87y,gcopf88mcif1zdhjyscikrtscw] Test One
|20:51 <hloeung> [↪c9ouoenfkprajc6o96zdp9z87y,gcopf88mcif1zdhjyscikrtscw] Test Two
|20:51 <hloeung> [↪c9ouoenfkprajc6o96zdp9z87y,gcopf88mcif1zdhjyscikrtscw] Test Three (re @hloeung: Test One Test Two Test …)
|20:52 <hloeung> [↪c9ouoenfkprajc6o96zdp9z87y] Test One
|20:52 <hloeung> [↪c9ouoenfkprajc6o96zdp9z87y] Test Two
|20:52 <hloeung> [↪c9ouoenfkprajc6o96zdp9z87y] Test Three (re @hloeung: Test One Test Two Test …)
42wim commented 2 years ago

@hloeung can you look at the conflicts below (bridge/mattermost6/mattermost.go)?

hloeung commented 2 years ago

@42wim ok removed that block

42wim commented 1 year ago

This is getting a bit too complex though :/

It doesn't seem to work correctly when using prefixcontext A multiline message now shows this for me

21:56 <@wim> [001] this are multiple
21:56 <@wim> [002] lines
21:56 <@wim> [003] with
21:56 <@wim> [004] ```
21:56 <@wim> [005] codeblock
21:56 <@wim> [006]
21:56 <@wim> [007] ```
21:56 <@wim> [008] done

and only replying on @@008 works, no way to see that this is a multiline message.

with hidecontextmulti disabled it gives me this

22:28 <@wim> this are multiple
22:28 <@wim> lines
22:28 <@wim> with
22:28 <@wim> ```
22:28 <@wim> codeblock
22:28 <@wim> ```
22:28 <@wim> [001] done

(replying on @@001 works though)

while what I actually want is

22:28 <@wim> [001] this are multiple
22:28 <@wim> lines
22:28 <@wim> with
22:28 <@wim> ```
22:28 <@wim> codeblock
22:28 <@wim> ```
22:28 <@wim> done

Other comments on the changes:

hloeung commented 1 year ago

@42wim , okay, try it out now!

I did some testing with all combinations I can think of.

|22:52 <hloeung> Testing
|22:52 <hloeung> [001] Test One
|22:52 <hloeung> [001] Test Two (space above)
|22:52 <hloeung> [001] Test Three
|22:52 <hloeung> [002] Test One
|22:52 <hloeung> Test Two (space above)
|22:52 <hloeung> Test Three
|22:53 <hloeung> [@@3pcmi4un7td5ups4oi7r3txjxe] Test One
|22:53 <hloeung> Test Two (space above)
|22:53 <hloeung> Test Three
|22:53 <hloeung> Test One
|22:53 <hloeung> Test Two (space above)
|22:53 <hloeung> Test Three [@@qowh4sewe7rtdcxzzn8o43mb1e]
|22:53 <hloeung> Test One
|22:53 <hloeung> Test Two (space above)
|22:53 <hloeung> Test Three (re @hloeung: Test One  Test Two (space …) [↪@@qowh4sewe7rtdcxzzn8o43mb1e]
|22:54 <hloeung> Test One
|22:54 <hloeung> Test Two (space above)
|22:54 <hloeung> Test Three (re @hloeung: Test One  Test Two (space …) [↪@@qowh4sewe7rtdcxzzn8o43mb1e,@@ko7b5wdkwpry78u1ugasb53jzc]
|22:54 <hloeung> Test One [↪@@qowh4sewe7rtdcxzzn8o43mb1e,@@iizy1uftnjnpuxaspq9gdw5wse]
|22:54 <hloeung> Test Two (space above) [↪@@qowh4sewe7rtdcxzzn8o43mb1e,@@iizy1uftnjnpuxaspq9gdw5wse]
|22:54 <hloeung> Test Three (re @hloeung: Test One  Test Two (space …) [↪@@qowh4sewe7rtdcxzzn8o43mb1e,@@iizy1uftnjnpuxaspq9gdw5wse]
|22:55 <hloeung> [↪@@qowh4sewe7rtdcxzzn8o43mb1e,@@3g597sjsu7nktbhueaayou1xbo] Test One
|22:55 <hloeung> [↪@@qowh4sewe7rtdcxzzn8o43mb1e,@@3g597sjsu7nktbhueaayou1xbo] Test Two (space above)
|22:55 <hloeung> [↪@@qowh4sewe7rtdcxzzn8o43mb1e,@@3g597sjsu7nktbhueaayou1xbo] Test Three (re @hloeung: Test One  Test Two (space …)
|22:55 <hloeung> [@@usxm55ixaintpci43a6eghz6kw] Test One
|22:55 <hloeung> [@@usxm55ixaintpci43a6eghz6kw] Test Two (space above)
|22:55 <hloeung> [@@usxm55ixaintpci43a6eghz6kw] Test Three
42wim commented 1 year ago

Thanks a lot for your work / time on this!