diff --git a/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy b/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy index 022d1a6f..a31384a5 100644 --- a/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy +++ b/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy @@ -31,6 +31,7 @@ class MuWireSettings { boolean shareHiddenFiles boolean searchComments boolean browseFiles + boolean enableChat Set watchedDirectories float downloadSequentialRatio int hostClearInterval, hostHopelessInterval, hostRejectInterval @@ -79,6 +80,7 @@ class MuWireSettings { speedSmoothSeconds = Integer.valueOf(props.getProperty("speedSmoothSeconds","60")) totalUploadSlots = Integer.valueOf(props.getProperty("totalUploadSlots","-1")) uploadSlotsPerUser = Integer.valueOf(props.getProperty("uploadSlotsPerUser","-1")) + enableChat = Boolean.valueOf(props.getProperty("enableChat","false")) watchedDirectories = DataUtil.readEncodedSet(props, "watchedDirectories") watchedKeywords = DataUtil.readEncodedSet(props, "watchedKeywords") @@ -127,6 +129,7 @@ class MuWireSettings { props.setProperty("speedSmoothSeconds", String.valueOf(speedSmoothSeconds)) props.setProperty("totalUploadSlots", String.valueOf(totalUploadSlots)) props.setProperty("uploadSlotsPerUser", String.valueOf(uploadSlotsPerUser)) + props.setProperty("enableChat", String.valueOf(enableChat)) DataUtil.writeEncodedSet(watchedDirectories, "watchedDirectories", props) DataUtil.writeEncodedSet(watchedKeywords, "watchedKeywords", props) diff --git a/core/src/main/groovy/com/muwire/core/chat/ChatConnectionAttemptStatus.java b/core/src/main/groovy/com/muwire/core/chat/ChatConnectionAttemptStatus.java new file mode 100644 index 00000000..d736eca4 --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/chat/ChatConnectionAttemptStatus.java @@ -0,0 +1,5 @@ +package com.muwire.core.chat; + +public enum ChatConnectionAttemptStatus { + SUCCESSFUL, REJECTED, FAILED +} diff --git a/core/src/main/groovy/com/muwire/core/chat/ChatConnectionEvent.groovy b/core/src/main/groovy/com/muwire/core/chat/ChatConnectionEvent.groovy new file mode 100644 index 00000000..65b314ec --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/chat/ChatConnectionEvent.groovy @@ -0,0 +1,9 @@ +package com.muwire.core.chat + +import com.muwire.core.Event +import com.muwire.core.Persona + +class ChatConnectionEvent extends Event { + ChatConnectionAttemptStatus status + Persona persona +} diff --git a/core/src/main/groovy/com/muwire/core/chat/ChatDisconnectionEvent.groovy b/core/src/main/groovy/com/muwire/core/chat/ChatDisconnectionEvent.groovy new file mode 100644 index 00000000..003361c1 --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/chat/ChatDisconnectionEvent.groovy @@ -0,0 +1,8 @@ +package com.muwire.core.chat + +import com.muwire.core.Event +import com.muwire.core.Persona + +class ChatDisconnectionEvent extends Event { + Persona persona +} diff --git a/core/src/main/groovy/com/muwire/core/chat/ChatMessageEvent.groovy b/core/src/main/groovy/com/muwire/core/chat/ChatMessageEvent.groovy new file mode 100644 index 00000000..c4d103fe --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/chat/ChatMessageEvent.groovy @@ -0,0 +1,12 @@ +package com.muwire.core.chat + +import com.muwire.core.Event +import com.muwire.core.Persona + +class ChatMessageEvent extends Event { + String payload + Persona sender + String room + long chatTime + byte [] sig +}