NetworkSendPayloadFromRequest builds the shared send response payload from the original request plus the assigned message id.
(id string, req contract.NetworkSendRequest)
| 483 | // NetworkSendPayloadFromRequest builds the shared send response payload |
| 484 | // from the original request plus the assigned message id. |
| 485 | func NetworkSendPayloadFromRequest(id string, req contract.NetworkSendRequest) contract.NetworkSendPayload { |
| 486 | return contract.NetworkSendPayload{ |
| 487 | ID: strings.TrimSpace(id), |
| 488 | WorkspaceID: strings.TrimSpace(req.WorkspaceID), |
| 489 | SessionID: strings.TrimSpace(req.SessionID), |
| 490 | Channel: strings.TrimSpace(req.Channel), |
| 491 | Surface: strings.TrimSpace(req.Surface), |
| 492 | ThreadID: strings.TrimSpace(req.ThreadID), |
| 493 | DirectID: strings.TrimSpace(req.DirectID), |
| 494 | Kind: strings.TrimSpace(req.Kind), |
| 495 | To: strings.TrimSpace(req.To), |
| 496 | Mentions: cloneTrimmedStrings(req.Mentions), |
| 497 | WorkID: strings.TrimSpace(req.WorkID), |
| 498 | ReplyTo: strings.TrimSpace(req.ReplyTo), |
| 499 | TraceID: strings.TrimSpace(req.TraceID), |
| 500 | CausationID: strings.TrimSpace(req.CausationID), |
| 501 | ExpiresAt: cloneInt64Ptr(req.ExpiresAt), |
| 502 | Ext: cloneRawMap(req.Ext), |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | // NetworkPeerPayloadsFromInfos converts the visible peer snapshot into shared payloads. |
| 507 | func NetworkPeerPayloadsFromInfos(peers []network.PeerInfo) []contract.NetworkPeerPayload { |
no test coverage detected