Skip to content

Commit

Permalink
chore(settings.go): bump AppVersion to v4.21.0 for new release
Browse files Browse the repository at this point in the history
feat(message.go): add logging for MarkAsRead function using logrus for better traceability

fix(GroupManageParticipants.js): remove redundant '@' from group_id computation
  • Loading branch information
aldinokemal committed Oct 29, 2024
1 parent ddff32a commit 2874a55
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 4 deletions.
46 changes: 45 additions & 1 deletion docs/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
info:
title: WhatsApp API MultiDevice
version: 4.3.0
version: 4.4.0
description: This API is used for sending whatsapp via API
servers:
- url: http://localhost:3000
Expand Down Expand Up @@ -835,6 +835,50 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ErrorInternalServer'
/message/{message_id}/read:
post:
operationId: readMessage
tags:
- message
summary: Mark as read message
parameters:
- in: path
name: message_id
schema:
type: string
required: true
description: Message ID
requestBody:
content:
application/json:
schema:
type: object
properties:
phone:
type: string
example: '[email protected]'
description: Phone number with country code
required:
- phone
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SendResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBadRequest'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInternalServer'
/group:
post:
operationId: createGroup
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ You can fork or edit this source code !
|| React Message | POST | /message/:message_id/reaction |
|| Delete Message | POST | /message/:message_id/delete |
|| Edit Message | POST | /message/:message_id/update |
|| Read Message (DM) | POST | /message/:message_id/read |
|| Star message | POST | /message/:message_id/star |
|| Join Group With Link | POST | /group/join-with-link |
|| Leave Group | POST | /group/leave |
Expand All @@ -136,7 +137,7 @@ You can fork or edit this source code !
|| Remove Participant in Group | POST | /group/participants/remove |
|| Promote Participant in Group | POST | /group/participants/promote |
|| Demote Participant in Group | POST | /group/participants/demote |
|| Unfollow Newsletter | POST | /newsletter/unfollow |
|| Unfollow Newsletter | POST | /newsletter/unfollow |

```
✅ = Available
Expand Down
2 changes: 1 addition & 1 deletion src/config/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

var (
AppVersion = "v4.20.0"
AppVersion = "v4.21.0"
AppPort = "3000"
AppDebug = false
AppOs = "AldinoKemal"
Expand Down
8 changes: 8 additions & 0 deletions src/services/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
domainMessage "github.com/aldinokemal/go-whatsapp-web-multidevice/domains/message"
"github.com/aldinokemal/go-whatsapp-web-multidevice/pkg/whatsapp"
"github.com/aldinokemal/go-whatsapp-web-multidevice/validations"
"github.com/sirupsen/logrus"
"go.mau.fi/whatsmeow"
"go.mau.fi/whatsmeow/appstate"
"go.mau.fi/whatsmeow/proto/waCommon"
Expand Down Expand Up @@ -41,6 +42,13 @@ func (service serviceMessage) MarkAsRead(ctx context.Context, request domainMess
return response, err
}

logrus.Info(map[string]interface{}{
"phone": request.Phone,
"message_id": request.MessageID,
"chat": dataWaRecipient.String(),
"sender": service.WaCli.Store.ID.String(),
})

response.MessageID = request.MessageID
response.Status = fmt.Sprintf("Mark as read success %s", request.MessageID)
return response, nil
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/GroupManageParticipants.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
},
computed: {
group_id() {
return `${this.group}@${window.TYPEGROUP}`;
return `${this.group}${window.TYPEGROUP}`;
},
},
methods: {
Expand Down

0 comments on commit 2874a55

Please sign in to comment.