Browse Source

chore(settings.go): bump AppVersion to v4.21.0 for new release

feat(message.go): add logging for MarkAsRead function using logrus for better traceability

fix(GroupManageParticipants.js): remove redundant '@' from group_id computation
pull/208/head
Aldino Kemal 1 year ago
parent
commit
2874a559ad
  1. 46
      docs/openapi.yaml
  2. 3
      readme.md
  3. 2
      src/config/settings.go
  4. 8
      src/services/message.go
  5. 2
      src/views/components/GroupManageParticipants.js

46
docs/openapi.yaml

@ -1,7 +1,7 @@
openapi: 3.0.0 openapi: 3.0.0
info: info:
title: WhatsApp API MultiDevice title: WhatsApp API MultiDevice
version: 4.3.0
version: 4.4.0
description: This API is used for sending whatsapp via API description: This API is used for sending whatsapp via API
servers: servers:
- url: http://localhost:3000 - url: http://localhost:3000
@ -835,6 +835,50 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrorInternalServer' $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: '62819273192397132@s.whatsapp.net'
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: /group:
post: post:
operationId: createGroup operationId: createGroup

3
readme.md

@ -128,6 +128,7 @@ You can fork or edit this source code !
| ✅ | React Message | POST | /message/:message_id/reaction | | ✅ | React Message | POST | /message/:message_id/reaction |
| ✅ | Delete Message | POST | /message/:message_id/delete | | ✅ | Delete Message | POST | /message/:message_id/delete |
| ✅ | Edit Message | POST | /message/:message_id/update | | ✅ | Edit Message | POST | /message/:message_id/update |
| ✅ | Read Message (DM) | POST | /message/:message_id/read |
| ❌ | Star message | POST | /message/:message_id/star | | ❌ | Star message | POST | /message/:message_id/star |
| ✅ | Join Group With Link | POST | /group/join-with-link | | ✅ | Join Group With Link | POST | /group/join-with-link |
| ✅ | Leave Group | POST | /group/leave | | ✅ | Leave Group | POST | /group/leave |
@ -136,7 +137,7 @@ You can fork or edit this source code !
| ✅ | Remove Participant in Group | POST | /group/participants/remove | | ✅ | Remove Participant in Group | POST | /group/participants/remove |
| ✅ | Promote Participant in Group | POST | /group/participants/promote | | ✅ | Promote Participant in Group | POST | /group/participants/promote |
| ✅ | Demote Participant in Group | POST | /group/participants/demote | | ✅ | Demote Participant in Group | POST | /group/participants/demote |
| ✅ | Unfollow Newsletter | POST | /newsletter/unfollow |
| ✅ | Unfollow Newsletter | POST | /newsletter/unfollow |
``` ```
✅ = Available ✅ = Available

2
src/config/settings.go

@ -5,7 +5,7 @@ import (
) )
var ( var (
AppVersion = "v4.20.0"
AppVersion = "v4.21.0"
AppPort = "3000" AppPort = "3000"
AppDebug = false AppDebug = false
AppOs = "AldinoKemal" AppOs = "AldinoKemal"

8
src/services/message.go

@ -7,6 +7,7 @@ import (
domainMessage "github.com/aldinokemal/go-whatsapp-web-multidevice/domains/message" 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/pkg/whatsapp"
"github.com/aldinokemal/go-whatsapp-web-multidevice/validations" "github.com/aldinokemal/go-whatsapp-web-multidevice/validations"
"github.com/sirupsen/logrus"
"go.mau.fi/whatsmeow" "go.mau.fi/whatsmeow"
"go.mau.fi/whatsmeow/appstate" "go.mau.fi/whatsmeow/appstate"
"go.mau.fi/whatsmeow/proto/waCommon" "go.mau.fi/whatsmeow/proto/waCommon"
@ -41,6 +42,13 @@ func (service serviceMessage) MarkAsRead(ctx context.Context, request domainMess
return response, err 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.MessageID = request.MessageID
response.Status = fmt.Sprintf("Mark as read success %s", request.MessageID) response.Status = fmt.Sprintf("Mark as read success %s", request.MessageID)
return response, nil return response, nil

2
src/views/components/GroupManageParticipants.js

@ -10,7 +10,7 @@ export default {
}, },
computed: { computed: {
group_id() { group_id() {
return `${this.group}@${window.TYPEGROUP}`;
return `${this.group}${window.TYPEGROUP}`;
}, },
}, },
methods: { methods: {

Loading…
Cancel
Save