diff --git a/src/Room/V1/Send.c b/src/Room/V1/Send.c index b5b4dca..630178d 100644 --- a/src/Room/V1/Send.c +++ b/src/Room/V1/Send.c @@ -338,13 +338,6 @@ RoomAddEventV1(Room *room, PduV1 pdu, PduV1Status status) /* If we have a membership change, then add it to the * proper table. */ - { - CommonID *id = UserIdParse(pdu.sender, NULL); - User *user = UserLockID(room->db, id); - UserPushEvent(user, pdu_json); - UserUnlock(user); - UserIdFree(id); - } if (relates_to && RelationFromJson(relates_to, &rel, &errp)) { DbRef *relate = DbLock( diff --git a/src/User.c b/src/User.c index 6248160..9aeab69 100644 --- a/src/User.c +++ b/src/User.c @@ -1387,6 +1387,8 @@ UserPushEvent(User *user, HashMap *event) UserPushJoinSync(user, roomId); + /* TODO: In some very fun cases, this loop could be cosmically slow. + * Especially in the scale of 1.5k sync tokens. It can happen. */ entries = DbList(user->db, 3, "users", user->name, "sync"); for (i = 0; i < ArraySize(entries); i++) { @@ -1859,7 +1861,7 @@ UserIsSyncOld(User *user, char *token) dt = UtilTsMillis() - JsonValueAsInteger(HashMapGet(map, "creation")); DbUnlock(user->db, ref); - return dt > (3 * 24 * 60 * 60 * 1000); /* Three days of timeout. */ + return dt > (3 * 60 * 60 * 1000); /* Three hours of timeout. */ } bool UserSyncExists(User *user, char *sync)