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

Bridge Extra IRC Events: QUIT, KICK, TOPIC, MODE #33

Closed
wants to merge 0 commits into from

Conversation

@Zarthus
Copy link
Contributor

commented Jul 25, 2019

Adds bridging of KICK, QUIT

Optionally bridge TOPIC, MODE with the announce-extras config

Also fixes a typo in a file name

Feel free to cherry pick specific changes you're interested in. I'm not sure why the CI is failing.

@zachbr

This comment has been minimized.

Copy link
Owner

commented Jul 25, 2019

Feel free to bump the KIRC dependency version. I knew it would need this and reported the topic thing to mbax a while ago.

@Zarthus

This comment has been minimized.

Copy link
Contributor Author

commented Jul 25, 2019

I can blindly bump it but if it requires any bigger overhauls I'm not sure if I'm up for dealing with the fallout just to support non-buggy topics :P For now it's hidden behind an option that's false by default (I'm aware of at least the Nonsecure Trust Manager thing being removed)

@zachbr

This comment has been minimized.

Copy link
Owner

commented Jul 25, 2019

I'll take a look and throw it on this PR.

@zachbr zachbr closed this Jul 29, 2019

@zachbr zachbr force-pushed the Zarthus:master branch from bcfe875 to 7aba86c Jul 29, 2019

@zachbr

This comment has been minimized.

Copy link
Owner

commented Jul 29, 2019

accidentally pushed master over this 😅.
If you can re-open this we can continue.

The diff for the KIRC bump is very minor.

diff --git a/build.gradle b/build.gradle
index 4ad6593..e57207a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -62,7 +62,7 @@ shadowJar {
 
 dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
-    implementation "org.kitteh.irc:client-lib:5.1.2"
+    implementation "org.kitteh.irc:client-lib:7.2.2"
     implementation("net.dv8tion:JDA:3.8.3_463") {
         exclude module: 'opus-java'
     }
diff --git a/src/main/kotlin/io/zachbr/dis4irc/bridge/pier/irc/IrcExtrasListener.kt b/src/main/kotlin/io/zachbr/dis4irc/bridge/pier/irc/IrcExtrasListener.kt
index a9d4232..4a4a8fc 100644
--- a/src/main/kotlin/io/zachbr/dis4irc/bridge/pier/irc/IrcExtrasListener.kt
+++ b/src/main/kotlin/io/zachbr/dis4irc/bridge/pier/irc/IrcExtrasListener.kt
@@ -21,7 +21,7 @@ class IrcExtrasListener(private val pier: IrcPier) {
     fun onModeChange(event: ChannelModeEvent) {
         val receiveTimestamp = System.nanoTime()
         val sender = BOT_SENDER
-        val msgContent = "${event.actor.name} changed channel modes: ${event.statusList.statusString}"
+        val msgContent = "${event.actor.name} changed channel modes: ${event.statusList.asString}"
         logger.debug("IRC MODE CHANGE ${event.channel}")
 
         val source = event.channel.asBridgeSource()
@@ -34,10 +34,10 @@ class IrcExtrasListener(private val pier: IrcPier) {
         val receiveTimestamp = System.nanoTime()
         val sender = BOT_SENDER
         var topicSetter = ""
-        if (event.topic.setter.isPresent) {
-            topicSetter = " set by " + event.topic.setter.get().name
+        if (event.newTopic.setter.isPresent) {
+            topicSetter = " set by " + event.newTopic.setter.get().name
         }
-        val topicValue = event.topic.value.orElse("Unknown topic")
+        val topicValue = event.newTopic.value.orElse("Unknown topic")
         val msgContent = "Topic$topicSetter: $topicValue"
         logger.debug("IRC TOPIC$topicSetter: $topicValue")
 
diff --git a/src/main/kotlin/io/zachbr/dis4irc/bridge/pier/irc/IrcMessageListener.kt b/src/main/kotlin/io/zachbr/dis4irc/bridge/pier/irc/IrcMessageListener.kt
index 1637304..cce1e3c 100644
--- a/src/main/kotlin/io/zachbr/dis4irc/bridge/pier/irc/IrcMessageListener.kt
+++ b/src/main/kotlin/io/zachbr/dis4irc/bridge/pier/irc/IrcMessageListener.kt
@@ -12,7 +12,7 @@ import io.zachbr.dis4irc.bridge.message.Message
 import net.engio.mbassy.listener.Handler
 import org.kitteh.irc.client.library.event.channel.ChannelCtcpEvent
 import org.kitteh.irc.client.library.event.channel.ChannelMessageEvent
-import org.kitteh.irc.client.library.event.client.ClientConnectionClosedEvent
+import org.kitteh.irc.client.library.event.connection.ClientConnectionClosedEvent
 import org.kitteh.irc.client.library.event.user.PrivateMessageEvent
 import org.kitteh.irc.client.library.event.user.PrivateNoticeEvent
 import org.kitteh.irc.client.library.util.Format

Also the topic bridging will need to be behind a config option off by default.

@Zarthus

This comment has been minimized.

Copy link
Contributor Author

commented Jul 29, 2019

I can't reopen, actually, but I can re-push the commits. One sec

zachbr added a commit that referenced this pull request Jul 31, 2019

Merge pull request #35 from Zarthus/master
Bridge Extra IRC Events: QUIT, KICK, TOPIC, MODE #33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.