bug fix for conversation/direct
This commit is contained in:
parent
9faaa4f0dc
commit
aa9c1859b5
4 changed files with 45 additions and 4 deletions
13
streaming.go
13
streaming.go
|
@ -39,6 +39,13 @@ type DeleteEvent struct{ ID ID }
|
|||
|
||||
func (e *DeleteEvent) event() {}
|
||||
|
||||
// ConversationEvent is a struct for passing conversationevent to app.
|
||||
type ConversationEvent struct {
|
||||
Conversation *Conversation `json:"conversation"`
|
||||
}
|
||||
|
||||
func (e *ConversationEvent) event() {}
|
||||
|
||||
// ErrorEvent is a struct for passing errors to app.
|
||||
type ErrorEvent struct{ err error }
|
||||
|
||||
|
@ -100,6 +107,12 @@ func handleReader(q chan Event, r io.Reader) error {
|
|||
if err == nil {
|
||||
q <- &NotificationEvent{¬ification}
|
||||
}
|
||||
case "conversation":
|
||||
var conversation Conversation
|
||||
err = json.Unmarshal([]byte(token[1]), &conversation)
|
||||
if err == nil {
|
||||
q <- &ConversationEvent{&conversation}
|
||||
}
|
||||
case "delete":
|
||||
q <- &DeleteEvent{ID: ID(strings.TrimSpace(token[1]))}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue