- Implement new SendLink Vue.js component for sending links with captions
- Enhance URL metadata extraction with more robust image and title detection
- Add support for resolving relative image URLs
- Improve image download and validation process
- Update services and views to support link sending functionality
- Add detection of image transparency across different image formats
- Implement white background rendering for images with transparency
- Support converting transparent images to JPEG/PNG with white background
- Enhance image metadata extraction with transparency checks
- Add logging for transparency processing and image conversion
- Enhance image dimension detection by decoding actual image data
- Add support for detecting image dimensions from downloaded images
- Implement fallback to Open Graph tags if image decoding fails
- Handle square images by setting width and height to nil
- Improve thumbnail upload process for WhatsApp messages
- Add logging for image dimensions and thumbnail upload status
- Restructure WebSocket code for better readability and maintainability
- Extract connection registration, unregistration, and broadcast logic into separate functions
- Improve error handling and logging for WebSocket operations
- Simplify message broadcasting and connection management
- Add more descriptive logging for WebSocket events
- Refactor `init.go` to break down complex event handler into smaller, focused functions
- Add type definitions and comments to improve code readability
- Extract event handling logic into separate functions for better maintainability
- Improve error handling and logging in database initialization
- Add `FormatJID` utility function to handle JID formatting
- Update README with minor formatting improvements
- 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
Refactored WebSocket URL construction into a separate constructWebSocketURL method and updated login/logout API paths to use relative URLs instead of absolute paths.
* 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(newsletter): add newsletter service, endpoints, and UI components
Add Newsletter service to support functionality for unfollowing newsletters
Add Newsletter REST controller and routing
Implement newsletter-related endpoints and methods in the User Service
Create UnfollowRequest for the INewsletterService interface
Add MyListNewsletterResponse to user's data fields
Add newsletter validation
Refactor JS components to support newsletter type and simplify recipient forms by moving logic to FormRecipient component
Refactor window global constants to support newsletters
Modify server to initialize and use the newsletter services
Add UI component for listing newsletters
Refactor existing components to use FormRecipient for recipient data input
* chore: update documentation
feat(openapi.yaml): add newsletter support with new paths and schemas
docs(readme.md): update API endpoints including newsletter and images
fix(openapi.yaml): correct duplicated summary text for user my newsletters
* feat: update package name
* feat: Update src/views/components/NewsletterList.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: Update src/views/components/NewsletterList.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: Update src/views/components/NewsletterList.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
refactor(send.go): replace direct media upload calls with a new uploadMedia method to centralize logic
fix(send.go): fix context parameter in getMentionFromText, rename parameter to avoid unused variable warning
* Update index.html
Instead of using .AppHost, there will be issues when using a domain, for example, Cloudflare HTTPS, while on the host side using HTTP requests.
* HTTPS & HTTP Problem Axios Request
Instead of using .AppHost, there will be issues when using a domain, for example, Cloudflare HTTPS, while on the host side using HTTP requests.
Add auto reconnect checking in `SetAutoReconnectChecking` function
to ensure continuous connection by reconnecting every 5 minutes when
disconnected.
fix: update dependencies
Update dependencies in go.mod and go.sum for compatibility and
performance improvements:
- github.com/valyala/fasthttp v1.55.0 to v1.56.0
- github.com/klauspost/compress v1.17.9 to v1.17.10
- go.mau.fi/whatsmeow v0.0.0-20240911102933-bb3364aa3986 to
v0.0.0-20240927134544-69ba055bef0f
- go.mau.fi/util v0.7.0 to v0.8.0
* 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
chore(.github/workflows): upgrade actions/setup-go from version 4 to version 5 for all release workflows (linux, mac, and windows). This update provides the latest features and improvements of the setup-go action.
* 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