Callback function for private messages (GUI)

Callback function for private messages (GUI)

par Gabriel Giamarchi,
Nombre de réponses : 1

Last minute question due to manual testing :-)

When sending private messages to other nodes via the GUI (or cli since it will go the same controller) it seems to me that:

1. The private message shows on the sending node's log due to line `/controller.go:150`

2. [Unexpected] The private msg does *not* show on the receiver gossiper's log, because we only look at Simple/Rumor messages at `controller.go:234`.

Maybe this is a remnant of when students had to implement more parts of the the GUI? May we add code to the controller for manual testing? 

En réponse à Gabriel Giamarchi

Re: Callback function for private messages (GUI)

par Pasindu Nivanthaka Tennage,

Hello

Yes you are right, this is a slight issue with the code we provided. As a work around, I suggest you to do the following, upon receiving the private message at destination.

rumourMessage := RumorMessage{

Origin: priv.Origin,

ID:     priv.ID,

Text:   priv.Text,

}


if g.callback != nil {

g.callback(g.identifier, GossipPacket{Rumor: &rumourMessage})

}

Hope this answers your question