message_event_response-changes (#19)

Reviewed-on: #19
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-12-22 22:35:48 +00:00
committed by phoenix
parent 66c7fc261f
commit 7ec1f58f6a
4 changed files with 10 additions and 14 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ type App struct {
AuthUrl string
ServiceUsername string
ServicePassphrase string
TwilioConfig *config.TwiloConfig
TwilioConfig *config.TwilioConfig
}
func Load() (*App, error) {
@@ -56,7 +56,7 @@ func Load() (*App, error) {
}
}
func loadTwilioConfig() (*config.TwiloConfig, error) {
func loadTwilioConfig() (*config.TwilioConfig, error) {
authSid := os.Getenv("TWILIO_AUTH_SID")
serviceSid := os.Getenv("TWILIO_SERVICE_SID")
authToken := os.Getenv("TWILIO_AUTH_TOKEN")
@@ -71,7 +71,7 @@ func loadTwilioConfig() (*config.TwiloConfig, error) {
} else if len(phoneNumber) == 0 {
return nil, fmt.Errorf("Twilio config phone number not provided")
} else {
cfg := config.TwiloConfig{}
cfg := config.TwilioConfig{}
cfg.AccountSID = authSid
cfg.AuthToken = authToken
cfg.ServiceSID = serviceSid
+1 -1
View File
@@ -57,7 +57,7 @@ func (s *Scheduler) ScheduleMessage(schMsg scheduling.ScheduledMessage, event sc
}
func (s *Scheduler) RecordEventResponse(schMsgEvent *scheduling.ScheduledMessageEvent, userId uuid.UUID, bytes []byte, sent *time.Time) ([]*message.MessageEventResponse, error) {
mre := message.MessageEventResponse{ScheduledMessageEventId: schMsgEvent.Id, UserId: userId, Response: bytes, Sent: *sent}
mre := message.MessageEventResponse{ScheduledMessageEventId: schMsgEvent.Id, UserId: userId, Response: bytes, Sent: *sent, Status: message.Message_Event_Response_Status_Scheduled}
msgEventResponse := MessageEventResponse{Application: s.Application, Token: s.Token}
if responses, err := msgEventResponse.RecordEventResponse(&mre); err != nil {