gui browse/feed/chat actions from upload table
This commit is contained in:
@ -29,6 +29,10 @@ class ChatManager {
|
||||
timer.schedule({connect()} as TimerTask, 1000, 1000)
|
||||
}
|
||||
|
||||
boolean isConnected(Persona p) {
|
||||
clients.containsKey(p)
|
||||
}
|
||||
|
||||
void onUIConnectChatEvent(UIConnectChatEvent e) {
|
||||
if (e.host == me) {
|
||||
eventBus.publish(new ChatConnectionEvent(status : ChatConnectionAttemptStatus.SUCCESSFUL,
|
||||
|
@ -152,4 +152,9 @@ class ContentUploader extends Uploader {
|
||||
public boolean isChatEnabled() {
|
||||
request.chat
|
||||
}
|
||||
|
||||
@Override
|
||||
public Persona getDownloaderPersona() {
|
||||
request.downloader
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.nio.ByteBuffer
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
||||
import com.muwire.core.InfoHash
|
||||
import com.muwire.core.Persona
|
||||
import com.muwire.core.connection.Endpoint
|
||||
|
||||
import net.i2p.data.Base64
|
||||
@ -90,4 +91,9 @@ class HashListUploader extends Uploader {
|
||||
public boolean isChatEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Persona getDownloaderPersona() {
|
||||
request.downloader
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import java.nio.charset.StandardCharsets
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.StandardOpenOption
|
||||
|
||||
import com.muwire.core.Persona
|
||||
import com.muwire.core.connection.Endpoint
|
||||
|
||||
abstract class Uploader {
|
||||
@ -31,6 +32,7 @@ abstract class Uploader {
|
||||
}
|
||||
|
||||
abstract String getName();
|
||||
|
||||
|
||||
/**
|
||||
* @return an integer between 0 and 100
|
||||
@ -38,6 +40,7 @@ abstract class Uploader {
|
||||
abstract int getProgress();
|
||||
|
||||
abstract String getDownloader();
|
||||
abstract Persona getDownloaderPersona();
|
||||
|
||||
abstract int getDonePieces();
|
||||
|
||||
|
Reference in New Issue
Block a user