Skip to content

Commit

Permalink
display self post
Browse files Browse the repository at this point in the history
  • Loading branch information
ryogrid committed Feb 14, 2024
1 parent fbd04bf commit d22d1fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
2 changes: 2 additions & 0 deletions api_server/api_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func (s *ApiServer) postEvent(w rest.ResponseWriter, req *rest.Request) {
for _, peerId := range s.buzzPeer.GetPeerList() {
s.buzzPeer.MessageMan.SendMsgUnicast(peerId, &schema.BuzzPacket{events, nil, nil})
}
// display for myself
fmt.Println(event.Tags["nickname"][0] + "> " + event.Content)
//s.buzzPeer.MessageMan.SendMsgBroadcast(&schema.BuzzPacket{events, nil, nil})

w.WriteJson(&PostEventResp{
Expand Down
23 changes: 0 additions & 23 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,29 +101,6 @@ var serverCmd = &cobra.Command{
go apiServ.LaunchAPIServer(host + ":" + strconv.Itoa(port+1))
}

// TODO: need to implement classes handle message sending and receiving (cmd.go)

// TODO: need to implemnt and create temporal post request receiver I/f manager (cmd.go)
/*
if name == 3 {
time.Sleep(5 * time.Second)
buzz_util.BuzzDbgPrintln("send hello buzzon")
event := schema.BuzzEvent{
Id: 0,
Pubkey: [32]byte{},
Created_at: 0,
Kind: 0,
Tags: nil,
Content: "hello buzzon",
Sig: [64]byte{},
}
events := []*schema.BuzzEvent{&event}
//peer.MessageMan.SendMsgUnicast(1, &schema.BuzzPacket{events, nil, nil})
//peer.MessageMan.SendMsgUnicast(2, &schema.BuzzPacket{events, nil, nil})
peer.MessageMan.SendMsgBroadcast(&schema.BuzzPacket{events, nil, nil})
peer.MessageMan.SendMsgBroadcast(&schema.BuzzPacket{events, nil, nil})
}
*/
buzz_util.OSInterrupt()
},
}
Expand Down

0 comments on commit d22d1fc

Please sign in to comment.