summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2013-05-16 09:48:26 +0200
committerYorhel <git@yorhel.nl>2013-05-16 09:48:26 +0200
commitb7cc09716ee4e46aefe077f821adfed0d7d98c23 (patch)
treede83af28a88a5c8217704e6edee414f239bb58da
parenta27137d30626f65d9ef919140a5a6579eece8eda (diff)
hub/nmdc: Don't update info of offline users
Fixes a bug introduced in previous commit.
-rw-r--r--src/hub/nmdc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hub/nmdc.c b/src/hub/nmdc.c
index 06ca7f3..048348a 100644
--- a/src/hub/nmdc.c
+++ b/src/hub/nmdc.c
@@ -328,7 +328,7 @@ static void hub_nmdc_userip_set(hub_t *h, int64_t uid, const char *ip) {
hub_user_t *u = hub_users_get(h, uid);
/* User is online, modify struct directly */
- if(u) {
+ if(u && u->online) {
hub_user_update_t d;
hub_user_update_init(h, &d, u);
if(inet_pton(AF_INET, ip, &d.u->ip4) == 1)
@@ -378,7 +378,7 @@ static void hub_nmdc_oplist_set(hub_t *h, int64_t uid) {
/* User is online, modify struct directly */
hub_user_t *u = hub_users_get(h, uid);
- if(u) {
+ if(u && u->online) {
hub_user_update_t d;
hub_user_update_init(h, &d, u);
if(!d.u->op)