-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bad-buffer-ids' into v1.9-dev
- Loading branch information
Showing
11 changed files
with
56 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 0 additions & 80 deletions
80
app/src/main/java/com/ubergeek42/WeechatAndroid/service/Events.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
app/src/main/java/com/ubergeek42/WeechatAndroid/service/Events.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
||
package com.ubergeek42.WeechatAndroid.service | ||
|
||
import com.ubergeek42.WeechatAndroid.relay.Buffer | ||
import com.ubergeek42.WeechatAndroid.relay.as0x | ||
import com.ubergeek42.WeechatAndroid.utils.Assert | ||
import org.greenrobot.eventbus.EventBus | ||
import java.util.EnumSet | ||
import java.util.Locale | ||
|
||
class Events { | ||
data class StateChangedEvent(@JvmField val state: EnumSet<RelayService.STATE>) | ||
|
||
data class ExceptionEvent(@JvmField val e: Exception) | ||
|
||
data class SendMessageEvent(@JvmField val message: String) { | ||
companion object { | ||
fun fire(message: String) { | ||
Assert.assertThat(message.endsWith("\n")).isFalse() | ||
EventBus.getDefault().post(SendMessageEvent(message)) | ||
} | ||
|
||
fun fireInput(buffer: Buffer, input: String?) { | ||
if (input.isNullOrEmpty()) return | ||
|
||
P.addSentMessage(input) | ||
|
||
input.lineSequence().filter(String::isNotEmpty).forEach { line -> | ||
fire("input ${buffer.pointer.as0x} $line") | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters