lalitmaganti / relay Goto Github PK
View Code? Open in Web Editor NEWAn open source IRC library for Android apps.
An open source IRC library for Android apps.
Currently, the relay library doesn't distinguish between NOTICE and PRIVMSG in the context of CTCP requests, which can (and does) cause loops. NOTICE should be used for CTCP responses, and PRIVMSG should be for CTCP requests.
correct behaviour:
//start of CTCP communication
Relay!Relay@somehost PRIVMSG client :\u00001VERSION\u00001
client!client@somehost NOTICE Relay :\u00001VERSION\u00001
// end of communication
current behaviour:
// start of CTCP communication
Relay!Relay@somehost PRIVMSG client :\u00001VERSION\u00001
client!client@somehost NOTICE Relay :\u00001VERSION\u00001 // and then this is interpreted as a CTCP request
Relay!Relay@somehost PRIVMSG client :\u00001VERSION\u00001
client!client@somehost NOTICE Relay :\u00001VERSION\u00001
// and so on...
I see the following crash in the HoloIRC Android app after trying to connect to the Slack IRC bridge using ZNC with history in the buffer. There may also be other ways to trigger the crash.
The app crashes the first time I connect, then works every time after that, I'm thinking It might be something to do with history playback.
I did a little digging and narrowed the error down to the line here in the Relay library. Looks like with the particular line ":irc.tinyspeck.com 305 :You are no longer marked as being away
" (from the logcat) there are exactly 3 strings in parsedArray
so when the first 3 are removed, there's nothing left. Trying to get the first element then causes a crash.
Logcat:
02-20 12:39:38.897 I/Timeline(817): Timeline: Activity_windows_visible id: ActivityRecord{42697698 u0 com.fusionx.lightirc/.ui.MainActivity t205} time:318515182
02-20 12:39:40.397 D/AndroidRuntime(16153): Shutting down VM
02-20 12:39:40.397 W/dalvikvm(16153): threadid=1: thread exiting with uncaught exception (group=0x415c8ce0)
02-20 12:39:40.537 E/AndroidRuntime(16153): FATAL EXCEPTION: main
02-20 12:39:40.537 E/AndroidRuntime(16153): Process: com.fusionx.lightirc, PID: 16153
02-20 12:39:40.537 E/AndroidRuntime(16153): java.lang.RuntimeException: :irc.tinyspeck.com 305 :You are no longer marked as being away
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.lambda$null$3(RelayIRCConnection.java:91)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.access$lambda$6(RelayIRCConnection.java)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection$$Lambda$9.run(Unknown Source)
02-20 12:39:40.537 E/AndroidRuntime(16153): at android.os.Handler.handleCallback(Handler.java:733)
02-20 12:39:40.537 E/AndroidRuntime(16153): at android.os.Handler.dispatchMessage(Handler.java:95)
02-20 12:39:40.537 E/AndroidRuntime(16153): at android.os.Looper.loop(Looper.java:136)
02-20 12:39:40.537 E/AndroidRuntime(16153): at android.app.ActivityThread.main(ActivityThread.java:5146)
02-20 12:39:40.537 E/AndroidRuntime(16153): at dalvik.system.NativeStart.main(Native Method)
02-20 12:39:40.537 E/AndroidRuntime(16153): Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
02-20 12:39:40.537 E/AndroidRuntime(16153): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
02-20 12:39:40.537 E/AndroidRuntime(16153): at java.util.ArrayList.get(ArrayList.java:308)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.parser.main.ServerLineParser.onParseServerCode(ServerLineParser.java:133)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.parser.main.ServerLineParser.parseLine(ServerLineParser.java:99)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.parser.main.ServerLineParser.parseMain(ServerLineParser.java:62)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.onStartParsing(RelayIRCConnection.java:250)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.connect(RelayIRCConnection.java:207)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.connectToServer(RelayIRCConnection.java:135)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.lambda$startConnection$4(RelayIRCConnection.java:88)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.access$lambda$0(RelayIRCConnection.java)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection$$Lambda$1.run(Unknown Source)
02-20 12:39:40.537 E/AndroidRuntime(16153): at java.lang.Thread.run(Thread.java:841)
02-20 12:39:40.547 W/ActivityManager(817): Force finishing activity com.fusionx.lightirc/.ui.MainActivity
02-20 12:39:41.167 W/ActivityManager(817): Activity pause timeout for ActivityRecord{42697698 u0 com.fusionx.lightirc/.ui.MainActivity t205 f}
02-20 12:39:41.797 I/Timeline(1971): Timeline: Activity_idle id: android.os.BinderProxy@41e1ed28 time:318518080
02-20 12:39:43.787 I/ActivityManager(817): Process com.fusionx.lightirc (pid 16153) has died.
02-20 12:39:43.787 I/WindowState(817): WIN DEATH: Window{437c3628 u0 com.fusionx.lightirc/com.fusionx.lightirc.ui.MainActivity}
02-20 12:39:43.787 W/ActivityManager(817): Service crashed 2 times, stopping: ServiceRecord{42eb6b08 u0 com.fusionx.lightirc/.service.IRCService}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.