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

Show "(guest)" by guest users' names, when setting enabled #5804

Closed
chrisbobbe opened this issue Dec 20, 2023 · 0 comments · Fixed by #5809
Closed

Show "(guest)" by guest users' names, when setting enabled #5804

chrisbobbe opened this issue Dec 20, 2023 · 0 comments · Fixed by #5809
Assignees

Comments

@chrisbobbe
Copy link
Contributor

This is to implement the "guest indicator" feature on mobile. Discussion: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Guest.20user.20indicator/near/1707770

@chrisbobbe chrisbobbe self-assigned this Dec 20, 2023
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
But if it's not in user data, just fall back to the user's name on
the message.

Soon we'll use the user data to show a "(guest)" marker if it
applies; this is zulip#5804.

The header doesn't actually live-update when a recipient user's name
changes (zulip#5208), because we don't yet use InboundEventEditSequence.
But I've added logic in the code that builds that inbound event, so
that the live-updating will happen if we ever do start using it.
Like we did for the followed-topic marker on stream recipient
headers, in 4ef0a0a.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
…able

But if it's not in user data, just fall back to sender_full_name on
the message, since that seems better than showing "(unknown user)".

Like in the previous commit, the main motivation for this is that
our new helper functions that will power the upcoming "Firstname
Lastname (guest)" feature, zulip#5804, need a User object.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
But if it's not in user data, just fall back to the user's name on
the message.

Soon we'll use the user data to show a "(guest)" marker if it
applies; this is zulip#5804. But as a bonus, this means that as long as
we have a User object (which we usually will), we'll live-update the
sender's name, here, if it changes.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
And do some nice cleanups that this enables. See
kMinAllowedServerVersion, which is 4.0.

Now, we can implement the "guest indicator" feature (zulip#5804) without
having to write unused fallback code for a missing `.role`.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
Making sure that it chooses '(unknown user)' or 'Muted user', as
appropriate. We're about to add another of that kind of thing --
'Firstname Lastname (guest)' -- for zulip#5804.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
Soon we'll have a version of the "full name or muted user text"
that's LocalizableReactText, not LocalizableText, because we want to
offer an italicized "(guest)" marker, for zulip#5804. Prepare for that by
using ZulipTextIntl for the names, since it can handle
LocalizableReactText, and our GetText function `_` cannot.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
Making sure that it chooses '(unknown user)' or 'Muted user', as
appropriate. We're about to add another of that kind of thing --
'Firstname Lastname (guest)' -- for zulip#5804.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
Soon we'll have a version of the "full name or muted user text"
that's LocalizableReactText, not LocalizableText, because we want to
offer an italicized "(guest)" marker, for zulip#5804. Prepare for that by
using ZulipTextIntl for the names, since it can handle
LocalizableReactText, and our GetText function `_` cannot.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 22, 2023
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
But if it's not in user data, just fall back to the user's name on
the message.

Soon we'll use the user data to show a "(guest)" marker if it
applies; this is zulip#5804.

The header doesn't actually live-update when a recipient user's name
changes (zulip#5208), because we don't yet use InboundEventEditSequence.
But I've added logic in the code that builds that inbound event, so
that the live-updating will happen if we ever do start using it.
Like we did for the followed-topic marker on stream recipient
headers, in 4ef0a0a.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
…able

But if it's not in user data, just fall back to sender_full_name on
the message, since that seems better than showing "(unknown user)".

Like in the previous commit, the main motivation for this is that
our new helper functions that will power the upcoming "Firstname
Lastname (guest)" feature, zulip#5804, need a User object.

In the tests for the "content" WebView inbound event, tweak the
example message so that its sender is the self-user. That's so the
tested code can access the sender's User object, since the self-user
is already included in the test's background data.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
But if it's not in user data, just fall back to the user's name on
the message.

Soon we'll use the user data to show a "(guest)" marker if it
applies; this is zulip#5804. But as a bonus, this means that as long as
we have a User object (which we usually will), we'll live-update the
sender's name, here, if it changes.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
And do some nice cleanups that this enables. See
kMinAllowedServerVersion, which is 4.0.

Now, we can implement the "guest indicator" feature (zulip#5804) without
having to write unused fallback code for a missing `.role`.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
Making sure that it chooses '(unknown user)' or 'Muted user', as
appropriate. We're about to add another of that kind of thing --
'Firstname Lastname (guest)' -- for zulip#5804.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
Soon we'll have a version of the "full name or muted user text"
that's LocalizableReactText, not LocalizableText, because we want to
offer an italicized "(guest)" marker, for zulip#5804. Prepare for that by
using ZulipTextIntl for the names, since it can handle
LocalizableReactText, and our GetText function `_` cannot.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
But if it's not in user data, just fall back to the user's name on
the message.

Soon we'll use the user data to show a "(guest)" marker if it
applies; this is zulip#5804.

The header doesn't actually live-update when a recipient user's name
changes (zulip#5208), because we don't yet use InboundEventEditSequence.
But I've added logic in the code that builds that inbound event, so
that the live-updating will happen if we ever do start using it.
Like we did for the followed-topic marker on stream recipient
headers, in 4ef0a0a.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
…able

But if it's not in user data, just fall back to sender_full_name on
the message, since that seems better than showing "(unknown user)".

Like in the previous commit, the main motivation for this is that
our new helper functions that will power the upcoming "Firstname
Lastname (guest)" feature, zulip#5804, need a User object.

In the tests for the "content" WebView inbound event, tweak the
example message so that its sender is the self-user. That's so the
tested code can access the sender's User object, since the self-user
is already included in the test's background data.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
But if it's not in user data, just fall back to the user's name on
the message.

Soon we'll use the user data to show a "(guest)" marker if it
applies; this is zulip#5804. But as a bonus, this means that as long as
we have a User object (which we usually will), we'll live-update the
sender's name, here, if it changes.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
And do some nice cleanups that this enables. See
kMinAllowedServerVersion, which is 4.0.

Now, we can implement the "guest indicator" feature (zulip#5804) without
having to write unused fallback code for a missing `.role`.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
Making sure that it chooses '(unknown user)' or 'Muted user', as
appropriate. We're about to add another of that kind of thing --
'Firstname Lastname (guest)' -- for zulip#5804.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
Soon we'll have a version of the "full name or muted user text"
that's LocalizableReactText, not LocalizableText, because we want to
offer an italicized "(guest)" marker, for zulip#5804. Prepare for that by
using ZulipTextIntl for the names, since it can handle
LocalizableReactText, and our GetText function `_` cannot.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 4, 2024
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 5, 2024
And do some nice cleanups that this enables. See
kMinAllowedServerVersion, which is 4.0.

Now, we can implement the "guest indicator" feature (zulip#5804) without
having to write unused fallback code for a missing `.role`.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 5, 2024
Making sure that it chooses '(unknown user)' or 'Muted user', as
appropriate. We're about to add another of that kind of thing --
'Firstname Lastname (guest)' -- for zulip#5804.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jan 5, 2024
Soon we'll have a version of the "full name or muted user text"
that's LocalizableReactText, not LocalizableText, because we want to
offer an italicized "(guest)" marker, for zulip#5804. Prepare for that by
using ZulipTextIntl for the names, since it can handle
LocalizableReactText, and our GetText function `_` cannot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant