github.com/status-im/status-go@v1.1.0/signal/events_messenger.go (about) 1 package signal 2 3 const ( 4 // EventMediaServerStarted triggers when the media server successfully binds a new port 5 EventMediaServerStarted = "mediaserver.started" 6 7 // EventMesssageDelivered triggered when we got acknowledge from datasync level, that means peer got message 8 EventMesssageDelivered = "message.delivered" 9 10 // EventCommunityInfoFound triggered when user requested info about some community and messenger successfully 11 // retrieved it from mailserver 12 EventCommunityInfoFound = "community.found" 13 14 // EventStatusUpdatesTimedOut Event Automatic Status Updates Timed out 15 EventStatusUpdatesTimedOut = "status.updates.timedout" 16 17 // EventCuratedCommunitiesUpdate triggered when it is time to refresh the list of curated communities 18 EventCuratedCommunitiesUpdate = "curated.communities.update" 19 ) 20 21 // MessageDeliveredSignal specifies chat and message that was delivered 22 type MessageDeliveredSignal struct { 23 ChatID string `json:"chatID"` 24 MessageID string `json:"messageID"` 25 } 26 27 // MediaServerStarted specifies chat and message that was delivered 28 type MediaServerStarted struct { 29 Port int `json:"port"` 30 } 31 32 // MessageDeliveredSignal specifies chat and message that was delivered 33 type CommunityInfoFoundSignal struct { 34 Name string `json:"name"` 35 Description string `json:"description"` 36 MembersCount int `json:"membersCount"` 37 Verified bool `json:"verified"` 38 } 39 40 // SendMessageDelivered notifies about delivered message 41 func SendMessageDelivered(chatID string, messageID string) { 42 send(EventMesssageDelivered, MessageDeliveredSignal{ChatID: chatID, MessageID: messageID}) 43 } 44 45 // SendMediaServerStarted notifies about restarts of the media server 46 func SendMediaServerStarted(port int) { 47 send(EventMediaServerStarted, MediaServerStarted{Port: port}) 48 } 49 50 // SendMessageDelivered notifies about delivered message 51 func SendCommunityInfoFound(community interface{}) { 52 send(EventCommunityInfoFound, community) 53 } 54 55 func SendStatusUpdatesTimedOut(statusUpdates interface{}) { 56 send(EventStatusUpdatesTimedOut, statusUpdates) 57 } 58 59 func SendCuratedCommunitiesUpdate(curatedCommunitiesUpdate interface{}) { 60 send(EventCuratedCommunitiesUpdate, curatedCommunitiesUpdate) 61 }