- Bumped versions for several dependencies:
- github.com/PuerkitoBio/goquery from v1.10.2 to v1.10.3
- github.com/mattn/go-sqlite3 from v1.14.27 to v1.14.28
- go.mau.fi/whatsmeow to a new version
- golang.org/x/image from v0.25.0 to v0.26.0
- golang.org/x/net from v0.38.0 to v0.39.0
- github.com/pelletier/go-toml/v2 from v2.2.3 to v2.2.4
- golang.org/x/crypto from v0.36.0 to v0.37.0
- Added new indirect dependencies for petermattis/goid and updated existing ones.
- Bumped API version from 5.3.0 to 5.4.0.
- Added new endpoints for managing group participant requests:
- GET /group/participant-requests to retrieve pending requests.
- POST /group/participant-requests/approve to approve requests.
- POST /group/participant-requests/reject to reject requests.
- Updated group service methods to handle new request types and responses.
- Enhanced front-end components to support requested member management.
- Introduce Viper for flexible configuration management
- Add `.env.example` file with comprehensive configuration options
- Implement environment variable and `.env` file loading
- Update root command to support configuration from multiple sources
- Add new configuration option for chat storage toggle
- Bump version to v5.2.0 to reflect significant configuration changes
- Introduce new configuration option `--chat-flush-interval` to control chat storage cleanup
- Implement periodic chat storage flushing with configurable interval (default 7 days)
- Migrate chat storage from text to CSV format for better data management
- Add thread-safe file handling for chat storage operations
- Update root command to support new chat flush interval flag
This PR introduce a new flag --db-uri to define a way to specify where to store the db (either locally using `file:` schema, or via `postgres:` schema)
> the database uri to store the connection data database uri (by default, we'll use sqlite3 under storages/whatsapp.db). database uri --db-uri <string> | example: --db-uri="file:storages/whatsapp.db?_foreign_keys=off or postgres://user:password@localhost:5432/whatsapp"`)
Fixes#163
* fix: update deps & bug fix
fix(go.mod): update module dependencies to latest versions to ensure compatibility and security
fix(whatsapp.go): enhance event message handling by adding quoted message field and streamline message building and media extraction functions
* fix: make webhook call async and add retry mechanism
fix(init.go): wrap forwardToWebhook call in a goroutine to make it async
feat(webhook.go): add timestamp field to the webhook payload
fix(webhook.go): implement retry logic for submitWebhook with exponential backoff
* feat: update version
* feat: add max download size validation for media files
- settings.go: add WhatsappSettingMaxDownloadSize for file size
validation (500MB)
- utils.go: check file size before writing media to disk, returning
an error if it exceeds the max limit
* fix: improve error handling and logging
fix(utils.go): replace panic with logrus error logging and return false
fix(webhook.go): add logrus error logging when media download fails
fix(webhook.go): add logrus info and warning logging for webhook submission attempts
* fix: add omitempty tags to JSON fields to avoid empty values
refactor(webhook.go): restructure createPayload to check and add fields conditionally, improving clarity and preventing unnecessary fields
refactor(webhook.go): handle media extraction only when media is present, improving readability and maintainability
* fix: add nil check for device in whatsapp init
fix(init.go): add check for nil device and log error before panic
Ensure proper error handling when no device is found
* feat: add mark as read
feat(message.go): add MarkAsRead functionality to IMessageService for marking messages as read
feat(go.mod): update dependencies to newer versions for improved functionality and security
feat(rest): add endpoint for MarkAsRead to handle marking messages as read through the API
feat(service): implement MarkAsRead logic in serviceMessage to mark messages as read in WhatsApp
feat(validations): add validation for MarkAsRead request to ensure required fields are present
* 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
* feat: update dependencies and improve mention detection
- upgrade Go version in go.mod to 1.23 and specify toolchain
- update several dependencies to their latest versions
- change mention detection to use regular expressions for better accuracy
- add tests for mention detection to verify correctness
* feat: upgrade version
feat: add --account-validation flag in root command for optional account validation
feat: enable WhatsappAccountValidation by default in settings
refactor: conditionally validate JID based on WhatsappAccountValidation flag in whatsapp package
* feat: manage participant
* refactor(group.go): change HTTP methods for managing group participants to use POST instead of DELETE and PATCH for better compatibility and consistency
* chore: update image homepage
chore(settings.go): update AppVersion to v4.9.2 for the latest release
chore(go.mod): update dependencies:
- go.mau.fi/whatsmeow to v0.0.0-20240209184912-c3e911dd6cfe
- go.mau.fi/util to v0.3.1-0.20240208085450-32294da153ab
- golang.org/x/crypto to v0.19.0
- golang.org/x/sys to v0.17.0
- github.com/rs/zerolog to v1.32.0
- github.com/godbus/dbus/v5 to v5.0.4
- github.com/rs/xid to v1.5.0
- github.com/pkg/errors to v0.9.1
- github.com/coreos/go-systemd/v22 to v22.5.0
- github.com/rs/zerolog to v1.32.0