Skip to content

cli: add name, image and relay server address flags#6944

Open
shumvgolove wants to merge 15 commits into
masterfrom
sh/cli-relay-flags
Open

cli: add name, image and relay server address flags#6944
shumvgolove wants to merge 15 commits into
masterfrom
sh/cli-relay-flags

Conversation

@shumvgolove
Copy link
Copy Markdown
Contributor

No description provided.

New CLI flag --relay-address-server SERVER selects the SMP server used
for the chat relay address link created at startup. Only valid together
with --relay; errors out otherwise.

Threads Maybe SMPServerWithAuth through APICreateMyAddress to the new
agent createConnection parameter.
@shumvgolove shumvgolove requested a review from epoberezkin as a code owner May 4, 2026 12:30
Selects or creates the active user non-interactively:
- no active user: create one with the given display name
- active user with matching localDisplayName: continue
- active user with different name: exit with error

Mutually exclusive with --create-bot-display-name.
Sets the active user's profile image from a .png/.jpg/.jpeg file at
startup. Reads file, base64-encodes as data URL, and updates the user
profile directly in the DB - no notification is sent to existing
contacts. Skips the update if the stored image already matches.

Requires --user-display-name.
@shumvgolove shumvgolove changed the title ci: add name, image and relay server address flags cli: add name, image and relay server address flags May 4, 2026
Comment thread src/Simplex/Chat/Controller.hs Outdated
Comment thread src/Simplex/Chat/Core.hs Outdated
Comment thread src/Simplex/Chat/Core.hs Outdated
Switch to the new wrapper instead of passing Nothing through createConnection
at every call site. Only APICreateMyAddress with srv_ Just routes through
the new wrapper.
- rename APICreateMyAddress field srv_ to server_
- extract repeated `loop` and putStrLn from createActiveUser via
  prompt where-clause
- fuse u_ inspection: validate active user display name in the same
  case that creates the user when missing
Reject the file if the encoded data URL exceeds 12500 bytes - matches
the cap mobile and desktop UIs pass to resizeImageToStrSize for profile
images. Without this, oversized images would be silently set on the
user profile.
Comment thread src/Simplex/Chat/Library/Commands.hs Outdated
Comment thread src/Simplex/Chat/Library/Commands.hs Outdated
epoberezkin and others added 7 commits May 5, 2026 09:24
Enforced in CreateActiveUser, updateProfile_, newGroup, runUpdateGroupProfile
via checkProfileImageSize; max 12500 bytes (matches mobile UIs).
Hide APICreateMyAddress server_ field so the bot doc generator does not
try to introspect SMPServerWithAuth (an unregistered type).
Add checkProfileSize / checkGroupProfileSize that encode the full
ChatMessage and check against maxEncodedInfoLength, so a long
displayName/bio combined with a near-max image is also caught at
command time instead of failing later at send time with CEException.

Run alongside the existing checkProfileImageSize (image-only cap of
12500 bytes, matching mobile UIs) in CreateActiveUser, updateProfile_,
newGroup, runUpdateGroupProfile. Update genProfileImg to fit the cap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants