|
|
|
@ -18,7 +18,7 @@ type MessageAction func() error
|
|
|
|
|
|
|
|
|
|
func MakeTextMessageAction(b *BridgeContext, m whatsapp.TextMessage) MessageAction {
|
|
|
|
|
return func() error {
|
|
|
|
|
if b.MessageWasSent(m.Info.Id) {
|
|
|
|
|
if !b.ShouldMessageBeSent(m.Info) {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ func MakeTextMessageAction(b *BridgeContext, m whatsapp.TextMessage) MessageActi
|
|
|
|
|
|
|
|
|
|
func MakeImageMessageAction(b *BridgeContext, m whatsapp.ImageMessage) MessageAction {
|
|
|
|
|
return func() error {
|
|
|
|
|
if b.MessageWasSent(m.Info.Id) {
|
|
|
|
|
if !b.ShouldMessageBeSent(m.Info) {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -84,7 +84,7 @@ func MakeImageMessageAction(b *BridgeContext, m whatsapp.ImageMessage) MessageAc
|
|
|
|
|
|
|
|
|
|
func MakeDocumentMessageAction(b *BridgeContext, m whatsapp.DocumentMessage) MessageAction {
|
|
|
|
|
return func() error {
|
|
|
|
|
if b.MessageWasSent(m.Info.Id) {
|
|
|
|
|
if !b.ShouldMessageBeSent(m.Info) {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -125,7 +125,7 @@ func MakeDocumentMessageAction(b *BridgeContext, m whatsapp.DocumentMessage) Mes
|
|
|
|
|
|
|
|
|
|
func MakeAudioMessageAction(b *BridgeContext, m whatsapp.AudioMessage) MessageAction {
|
|
|
|
|
return func() error {
|
|
|
|
|
if b.MessageWasSent(m.Info.Id) {
|
|
|
|
|
if !b.ShouldMessageBeSent(m.Info) {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -166,7 +166,7 @@ func MakeAudioMessageAction(b *BridgeContext, m whatsapp.AudioMessage) MessageAc
|
|
|
|
|
|
|
|
|
|
func MakeVideoMessageAction(b *BridgeContext, m whatsapp.VideoMessage) MessageAction {
|
|
|
|
|
return func() error {
|
|
|
|
|
if b.MessageWasSent(m.Info.Id) {
|
|
|
|
|
if !b.ShouldMessageBeSent(m.Info) {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -207,7 +207,7 @@ func MakeVideoMessageAction(b *BridgeContext, m whatsapp.VideoMessage) MessageAc
|
|
|
|
|
|
|
|
|
|
func MakeContactMessageAction(b *BridgeContext, m whatsapp.ContactMessage) MessageAction {
|
|
|
|
|
return func() error {
|
|
|
|
|
if b.MessageWasSent(m.Info.Id) {
|
|
|
|
|
if !b.ShouldMessageBeSent(m.Info) {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|