Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3. Timezone sharing ability - Sending and receiving timezone logic implementation #261

Open
1 task
tomastiminskas opened this issue Feb 5, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@tomastiminskas
Copy link
Contributor

tomastiminskas commented Feb 5, 2025

Implement logic to send current timezone when updated on specific chat and receive/store timezone on each chat.

Base branch: develop: All new changes needs to be done using develop branch as base branch. We use develop as base for Test Flight distribution releases

Context

When sending a message we use the Sphinx.send method. This method contains a msgJson param that will contain a json string with all message content including text, mediaKey (if attachment), amount (if boost), etc. This msgJson param now contains a new key metadata that can store and send any json string. We will use this metadata json to send timezone. When a message is received the msgJson sent by the msg sender is decoded using the Mappable class MessageInnerContent inside the init method of GenericIncomingMessage.

Requirements

MODELS

  • Add metadata field in MessageInnerContent struct

NEW TIMEZONE FORM

  • Implement logic to show value of timezoneEnabled for specific chat in new view toggle control
  • Implement logic to show value of timezoneIdentifier for specific chat in new view field (show Use Computer Settings if NULL)
  • Implement logic to store new values on chat when modified on new view form:
    • Save timezoneEnabled if toggle changed (TRUE/FALSE)
    • Save timezoneIdentifier from picker value if changed (Set to NULL if first option "Use Computer Settings" is selected from picker)
    • Update timezoneUpdated to TRUE when timezoneIdentifier value changes

SENDING TIMEZONE

  • Send json string with timezone inside metadata attribute (msg["metadata"] = "{\"timezone\": \"America/Los_Angeles\"}") on message (inside func formatMsg()) if timezoneEnabled == true and timezoneUpdated == true on the chat you are sending the message.
  • Set timezoneUpdated = false after message with timezoneIdentifier is sent (this will prevent timezone to be sent on every message if it doesn't changed)

RECEIVING TIMEZONE

  • Add timezone attribute in GenericIncomingMessage and save it inside innerContent.metaData if not empty.
  • Save remoteTimezoneIdentifier (coming as timezone inside metadata json) on chat when message is received in a contact conversation (chat.remoteTimezoneIdentifier) and on message when received in a tribe (message.remoteTimezoneIdentifier)

Acceptance Criteria

  • Implement logic to set timezone sharing for each contact/tribe, send it on message and receive store timezone information coming from others on incoming messages
@tomastiminskas tomastiminskas added the enhancement New feature or request label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant