How does the online presence work?

I like the online presence indicator. In our instance, it looks like a green border around the profile picture.

Screenshot 2023-03-17 at 12.26.56

I find it particularly useful to see in Chat Channels.

I’m curious how it works and when it switches “on” and "off. What constitutes being online? Is there a time limit for inactivity or lack of focus? Does it work with the Discourse Hub and a PWA as well as on a desktop browser?

Thanks for the info.

I’d like to include more info about it as part of a guide for those who are new to using chat channels and personal chat.

6 Likes

Hiya Simon! :wave:

I asked our chat team and they shared this note from the library that handles the user presence:

Which equates to: show online if…

  • browser is not in the background, and
  • there has been user activity in the last minute

Both are browsers, and allow user activity, so it will reflect it when the user is actually looking at the site (merely opening Discourse Hub app doesn’t constitute “viewing” the site in a browser, for instance).

Does that give you enough detail to share with your community? :slight_smile:

6 Likes

Thanks for the explanation - it is great to get it documented and discoverable!

How does the functionality differ from the @whos-online plugin?

I can see that the plugin adds a nice little indicator at the top of Topic lists as such:

But what about around avatars in non-chat areas? Or does the chat functionality do that too?

4 Likes

I’ve never used that plugin! :laughing:

However, from reading the topic at Discourse Who's Online Plugin and the code at discourse-whos-online/assets/javascripts/discourse/components/whos-online.js at main · discourse/discourse-whos-online · GitHub, I’m guessing it’s the same deal, but configurable via the settings (in this case, whos_online_active_timeago).

As for how they interact…

:crystal_ball: :face_with_monocle:

Do you use the plugin currently? If your plugin setting timer is set to 60 seconds, there might not be any way to tell which system is setting the active border on the avatars. :smiley:

4 Likes

I implemented it just before chat (and before realising that chat had it partially built-in).

I notice that here on Meta my presence isn’t noted in a Topic:

image

but is in Chat:

image

In my instance

However in my forum (with the plugin active) it does in topics too:
image        image

That is what you get for your money I guess! Haven’t noticed any clash between them.

3 Likes

Hmmm it is obviously not desirable to have two definitions of “who’s online”?

Can the chat “who’s online” service be leveraged to show where this plugin shows it currently and perhaps then the plugin can be retired?

3 Likes

Is there a way to put fake numbers of people online? I see that there is a site competing with mine that always lies about the number of people online to say that it is busier than mine! So I was wondering, is it possible to put 10 fake people online all the time + the real number of people online?

1 Like

Of course it is, and quote easily, but… why? There is no more content anyway.

That sounds… really childish. As childish as those ads telling my neighbour, who has surprisingly foreign name, has bought right now gizmo X, or those hundreds girls living next door, and I live middle of nowhere, want closer interactions exactly with me. Really — who believes and the most important point of view: who even cares?

How can I put these fake online users? (Change the number of online users in case)

1 Like

Sorry, but I don’t think that is an ethical thing to do.

I’d encourage you to rise above the misrepresentation of your competitor. And maybe call them out about it.

1 Like

I fully support your views on this. It’s just sort of aggressively showing yourself to be ‘more’ than you ‘truly are’. And that most of us do all the time in our day to day life (even though we may pretend that we don’t). Don’t we?

Yes. Perfect, thanks for sharing @maiki. :+1:

1 Like

But is there a way to do this? Is it really hard to do?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.