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 contact status in "Start chat" window #1520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eerielili
Copy link
Contributor

@eerielili eerielili commented Dec 8, 2023

Should close #139.

online:
image

away and xa (xa will be displayed as "Extended Away", same color):
image

dnd:
image

offline:
image

Note: displays the presence status at the moment of opening the window, not synced or polling every five seconds.

@eerielili eerielili force-pushed the show-contact-status-in-start-chat-window branch from 0aff794 to 989d1e7 Compare December 8, 2023 12:22
@eerielili
Copy link
Contributor Author

Made a slight change to support multiple devices presence:
image

@fiaxh
Copy link
Member

fiaxh commented Jan 10, 2024

Thanks for your PR.

I feel that this approach clutters this dialog with a lot of text, color and details that might be too specific for an overview dialog. Especially when a user is online with multiple devices.

My suggestion would be to have a small icon (smaller than text size) behind every name: A filled-in dot for an online user, a outlined dot for an offline user, a circle with clock hands for away and a circle with a bar for do-not-disturb. I'd suggest to merge all available devices into a single information: If one device is on do-not-disturb, the contact is do-not-disturb, no matter the other devices. If one device is away and another one online, the contact is online. This should provide the user with a general overview of the status of a contact, while not cluttering the dialog too much.

@eerielili
Copy link
Contributor Author

eerielili commented Jan 10, 2024

@fiaxh Good point, it does clutter after some thought and it can get confusing with 3 devices. Thanks you for the feedback.
I came up with this from your suggestions (there's blank space before the @ because i edited out the test username):

Online:
image

DND:
image

Away and extended away:
image

Offline:
image

There's also the "chat" status with this icon:
image
But i couldn't test it out.

Edit: My brain thought 'filled-in' for offline meant 'white with dotted outline'.

@eerielili eerielili force-pushed the show-contact-status-in-start-chat-window branch from 989d1e7 to e5f12d9 Compare January 10, 2024 21:57
@eerielili eerielili force-pushed the show-contact-status-in-start-chat-window branch from 5a575e5 to 92bea39 Compare January 28, 2024 01:05
@eerielili
Copy link
Contributor Author

eerielili commented Apr 1, 2024

I did expand on the issue #836 while at it, but I'll do it in a separate branch.

Copy link
Member

@fiaxh fiaxh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played a bit around with the layout and made some changes: The status icon is behind the name instead of in front of it, the icon is slightly smaller, and the offline icon is an outlined cicle.

Apart from that I'm not convinced of the filter for online status and would like to keep it out of the PR.

main/src/ui/add_conversation/list_row.vala Outdated Show resolved Hide resolved
main/src/ui/add_conversation/list_row.vala Outdated Show resolved Hide resolved
main/src/ui/add_conversation/list_row.vala Outdated Show resolved Hide resolved
should close dino#139
- adds svg dino-status-offline.svg
@eerielili eerielili force-pushed the show-contact-status-in-start-chat-window branch from 06aff3d to cf86892 Compare April 5, 2024 01:23
@eerielili
Copy link
Contributor Author

eerielili commented Apr 12, 2024

Thanks for the feedback and help. I saw you pushed some changes on my branch shifting some things around (to put the status icon in front for example) so I integrated them in my commit. Ditched the switch statement for the following since it's better for prioritizing status:

private void set_status_dot(StreamInteractor stream_interactor, Jid jid, Account account){
Gee.List<Jid>? full_jids = stream_interactor.get_module(PresenceManager.IDENTITY).get_full_jids(jid, account);
string presences = "";
if (full_jids != null){
for (int i = 0; i < full_jids.size; i++) {
Jid full_jid = full_jids[i];
string presence = stream_interactor.get_module(PresenceManager.IDENTITY).get_last_show(full_jid, account);
presences += presence + " ";
}
} else presences = null;
if (presences == null){
status_dot.set_from_icon_name("dino-status-offline");
return;
}
// Do not disturb > Interested in Chatting > Online > Away = Extended Away
if(presences.contains(Presence.Stanza.SHOW_DND)) {
status_dot.set_from_icon_name("dino-status-dnd");
return;
}
if(presences.contains(Presence.Stanza.SHOW_CHAT)){
status_dot.set_from_icon_name("dino-status-chat");
return;
}
if(presences.contains(Presence.Stanza.SHOW_ONLINE)) {
status_dot.set_from_icon_name("dino-status-online");
return;
}
if(presences.contains(Presence.Stanza.SHOW_AWAY) || presences.contains(Presence.Stanza.SHOW_XA)) {
status_dot.set_from_icon_name("dino-status-away");
return;
}
}

I moved the search online contacts functionality to another branch and force-pushed my present fork to cf86892.

Kind regards,
lili

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.

[FR] Show contact status in "Start Chat" window
2 participants