attach uuid to search results
This commit is contained in:
@@ -204,7 +204,7 @@ class ConnectionAcceptor {
|
||||
byte [] payload = new byte[jsonSize]
|
||||
dis.readFully(payload)
|
||||
def json = slurper.parse(payload)
|
||||
eventBus.publish(ResultsParser.parse(sender, json))
|
||||
eventBus.publish(ResultsParser.parse(sender, resultsUUID, json))
|
||||
}
|
||||
} catch (IOException | UnexpectedResultsException | InvalidSearchResultException bad) {
|
||||
log.log(Level.WARNING, "failed to process POST", bad)
|
||||
|
@@ -9,7 +9,7 @@ import com.muwire.core.util.DataUtil
|
||||
import net.i2p.data.Base64
|
||||
|
||||
class ResultsParser {
|
||||
public static UIResultEvent parse(Persona p, def json) throws InvalidSearchResultException {
|
||||
public static UIResultEvent parse(Persona p, UUID uuid, def json) throws InvalidSearchResultException {
|
||||
if (json.type != "Result")
|
||||
throw new InvalidSearchResultException("not a result json")
|
||||
if (json.version != 1)
|
||||
@@ -46,7 +46,8 @@ class ResultsParser {
|
||||
name : name,
|
||||
size : size,
|
||||
infohash : parsedIH,
|
||||
pieceSize : pieceSize)
|
||||
pieceSize : pieceSize,
|
||||
uuid : uuid)
|
||||
} catch (Exception e) {
|
||||
throw new InvalidSearchResultException("parsing search result failed",e)
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import com.muwire.core.Persona
|
||||
|
||||
class UIResultEvent extends Event {
|
||||
Persona sender
|
||||
UUID uuid
|
||||
String name
|
||||
long size
|
||||
InfoHash infohash
|
||||
|
Reference in New Issue
Block a user