insomniacslk / irc-slack

IRC-to-Slack gateway
BSD 3-Clause "New" or "Revised" License
195 stars 19 forks source link

Support private channels #165

Closed insomniacslk closed 3 years ago

insomniacslk commented 3 years ago

This patch adds support to private channels. Previously, private channels were read-only, while now it's bidirectional like public channels and IMs.

This required a refactoring of the channels API, and a few bug fixes. Now anything channel-related goes through the Channel and Channels structures, and should not use the Slack conversations API directly anymore.

Signed-off-by: Andrea Barberio insomniac@slackware.it

insomniacslk commented 3 years ago

CC @gjabell

codecov[bot] commented 3 years ago

Codecov Report

Merging #165 (71a4684) into master (3cfeb31) will decrease coverage by 0.85%. The diff coverage is 5.26%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #165      +/-   ##
=========================================
- Coverage    9.84%   8.99%   -0.86%     
=========================================
  Files           9       9              
  Lines        1026    1090      +64     
=========================================
- Hits          101      98       -3     
- Misses        921     987      +66     
- Partials        4       5       +1     
Flag Coverage Δ
unittest 8.99% <5.26%> (-0.86%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/ircslack/event_handler.go 0.00% <0.00%> (ø)
pkg/ircslack/irc_context.go 0.00% <0.00%> (ø)
pkg/ircslack/irc_server.go 0.00% <0.00%> (ø)
pkg/ircslack/channel.go 6.77% <6.77%> (ø)
pkg/ircslack/users.go 43.75% <8.82%> (-11.81%) :arrow_down:
pkg/ircslack/channels.go 37.63% <13.20%> (-32.58%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3cfeb31...71a4684. Read the comment docs.

insomniacslk commented 3 years ago

TODO before merging this PR: now the channel names in the chanlist don't show have the prefix anymore (e.g. general instead of #general)

insomniacslk commented 3 years ago

Tested on multiple teams on public and private channels, and on IM. Still not working in threads

insomniacslk commented 3 years ago

Now also tested on threads in public and private channels

insomniacslk commented 3 years ago

Messages and threads to self are not yet supported. See https://github.com/insomniacslk/irc-slack/issues/166

insomniacslk commented 3 years ago

Will merge this PR tomorrow if no other issue appears

insomniacslk commented 3 years ago

the last update fixes IMs that I broke accidentally in this PR. So now the test matrix is:

public channel private channel multiparty IM IM
from me works works doesn't work (roadmap) works
to me works works works works
thread from me works works untested doesn't work (roadmap)
thread to me works works untested works (sends in the IM chat)
insomniacslk commented 3 years ago

Updated readme with feature matrix

insomniacslk commented 3 years ago

Merged! This one took quite a lot of work, but I'm happy with the result (hopefully I won't take those words back :D ). Next is to add some serious testing, since any change to this project is hard to validate.