# How does the online presence work?

**URL:** https://meta.discourse.org/t/how-does-the-online-presence-work/258498
**Category:** Support
**Tags:** chat
**Created:** [March 17, 2023, 12:29pm UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498 "2023-03-17T12:29:18Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![simon\_tomes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon_tomes/32/457537_2.png) [@simon\_tomes](https://meta.discourse.org/u/simon_tomes)
#### Post date: [March 17, 2023, 12:29pm UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/1 "2023-03-17T12:29:18Z")

</div>

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](https://global.discourse-cdn.com/meta/original/4X/4/8/1/481c520b55ea3439696941d227771e21af7d56c2.png)

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.

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [March 18, 2023, 12:58am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/2 "2023-03-18T00:58:30Z")

</div>

Hiya Simon! 👋

> [@simon\_tomes](#):
>
> 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?

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

> <https://github.com/discourse/discourse/blob/v3.1.0.beta3/app/assets/javascripts/discourse/app/lib/user-presence.js#L16-L19>

Which equates to: show online if…

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

> [@simon\_tomes](#):
>
> Does it work with the Discourse Hub and a PWA as well as on a desktop browser?

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? 🙂

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [March 18, 2023, 1:14am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/3 "2023-03-18T01:14:58Z")

</div>

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:

[![](https://global.discourse-cdn.com/meta/original/3X/a/f/af9186cf7b6b694a8e00018fc67bce7f9f4e3660.gif) ](https://global.discourse-cdn.com/meta/original/3X/a/f/af9186cf7b6b694a8e00018fc67bce7f9f4e3660.gif)

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

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [March 18, 2023, 1:55am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/4 "2023-03-18T01:55:05Z")

</div>

> [@nathankershaw](#):
>
> How does the functionality differ from the @whos-online plugin?

I’ve never used that plugin! 😆

However, from reading the topic at [Discourse Who's Online](https://meta.discourse.org/t/discourse-whos-online/52345) and the code at [https://github.com/discourse/discourse-whos-online/blob/main/assets/javascripts/discourse/components/whos-online.js](https://github.com/discourse/discourse-whos-online/blob/main/assets/javascripts/discourse/components/whos-online.js), 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…

🔮 🧐

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. 😃

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [March 18, 2023, 2:59am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/5 "2023-03-18T02:59:35Z")

</div>

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](https://global.discourse-cdn.com/meta/original/4X/b/b/4/bb485deabda07db087ce40c07a3bc7847901829d.png)

but is in Chat:

![image](https://global.discourse-cdn.com/meta/original/4X/9/0/7/907067089051d9710c723ef72ad0921d939be7ce.png)

### In my instance

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

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/5/c/15c5fc5d5a8ce4a1a2aae906f136aead28199993.png) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ![image](https://global.discourse-cdn.com/meta/original/4X/5/a/7/5a7dd759e9e1afcb86a74e9a9fd76615ccf7bea6.png)

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

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [March 18, 2023, 7:38am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/6 "2023-03-18T07:38:03Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [March 18, 2023, 11:44am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/7 "2023-03-18T11:44:20Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 18, 2023, 1:27pm UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/8 "2023-03-18T13:27:41Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [March 18, 2023, 5:38pm UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/9 "2023-03-18T17:38:11Z")

</div>

> [@Jagster](#):
>
> ho, que tem nome surpreendentemente estrangeiro, comprou agora gizmo X, ou aquelas centenas de garotas que moram ao lado, e eu moro no meio do nada, querem interações mais próximas exatamente comigo. Realmente - quem acredita e o ponto de vista mais importante: quem se importa?

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

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [March 21, 2023, 3:30am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/13 "2023-03-21T03:30:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [March 21, 2023, 4:33am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/14 "2023-03-21T04:33:48Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![simon\_tomes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon_tomes/32/457537_2.png) [@simon\_tomes](https://meta.discourse.org/u/simon_tomes)
#### Post date: [March 21, 2023, 10:06am UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/15 "2023-03-21T10:06:01Z")

</div>

> [@maiki](#):
>
> Does that give you enough detail to share with your community? 🙂

Yes. Perfect, thanks for sharing @maiki. 👍

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [March 21, 2023, 3:20pm UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/16 "2023-03-21T15:20:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 20, 2023, 3:20pm UTC](https://meta.discourse.org/t/how-does-the-online-presence-work/258498/17 "2023-04-20T15:20:37Z")

</div>

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