ObjMatrix  Check-in [366f90be1a]

Overview
Comment:Track joined rooms
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 366f90be1acd4208fc680860c86914588ebfe465fd603095edc0648965a9b892
User & Date: js on 2020-10-11 18:34:58
Other Links: manifest | tags
Context
2020-10-31
17:09
Make sync loop automatic check-in: 63d344bd1d user: js tags: trunk
2020-10-11
18:34
Track joined rooms check-in: 366f90be1a user: js tags: trunk
2020-10-09
22:08
MTXStorage: Add support for storing joined rooms check-in: 027eb0e2f8 user: js tags: trunk
Changes

Modified src/MTXClient.m from [c274b7e572] to [ec0c7e8ba9].

419
420
421
422
423
424
425



426
427
428
429
430
431
432
433
434
435
436
437
438


























439
	}];

	objc_autoreleasePoolPop(pool);
}

- (void)processRoomsSync: (OFDictionary<OFString *, id> *)rooms
{



}

- (void)processPresenceSync: (OFDictionary<OFString *, id> *)presence
{
}

- (void)processAccountDataSync: (OFDictionary<OFString *, id> *)accountData
{
}

- (void)processToDeviceSync: (OFDictionary<OFString *, id> *)toDevice
{
}


























@end







>
>
>













>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
	}];

	objc_autoreleasePoolPop(pool);
}

- (void)processRoomsSync: (OFDictionary<OFString *, id> *)rooms
{
	[self processJoinedRooms: rooms[@"join"]];
	[self processInvitedRooms: rooms[@"invite"]];
	[self processLeftRooms: rooms[@"leave"]];
}

- (void)processPresenceSync: (OFDictionary<OFString *, id> *)presence
{
}

- (void)processAccountDataSync: (OFDictionary<OFString *, id> *)accountData
{
}

- (void)processToDeviceSync: (OFDictionary<OFString *, id> *)toDevice
{
}

- (void)processJoinedRooms: (OFDictionary<OFString *, id> *)rooms
{
	if (rooms == nil)
		return;

	for (OFString *roomID in rooms)
		[_storage addJoinedRoom: roomID
				forUser: _userID];
}

- (void)processInvitedRooms: (OFDictionary<OFString *, id> *)rooms
{
	if (rooms == nil)
		return;
}

- (void)processLeftRooms: (OFDictionary<OFString *, id> *)rooms
{
	if (rooms == nil)
		return;

	for (OFString *roomID in rooms)
		[_storage removeJoinedRoom: roomID
				   forUser: _userID];
}
@end

Modified src/MTXSQLite3Storage.m from [7f2482d98e] to [28eaed72b7].

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
		    @") VALUES (\n"
		    @"    $device_id, $next_batch\n"
		    @")"] retain];
		_nextBatchGetStatement = [[_conn prepareStatement:
		    @"SELECT next_batch FROM next_batch\n"
		    @"WHERE device_id=$device_id"] retain];
		_joinedRoomsAddStatement = [[_conn prepareStatement:
		    @"INSERT INTO joined_rooms (\n"
		    @"    user_id, room_id\n"
		    @") VALUES (\n"
		    @"    $user_id, $room_id\n"
		    @")"] retain];
		_joinedRoomsRemoveStatement = [[_conn prepareStatement:
		    @"DELETE FROM joined_rooms\n"
		    @"WHERE user_id=$user_id AND room_id=$room_id"] retain];







|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
		    @") VALUES (\n"
		    @"    $device_id, $next_batch\n"
		    @")"] retain];
		_nextBatchGetStatement = [[_conn prepareStatement:
		    @"SELECT next_batch FROM next_batch\n"
		    @"WHERE device_id=$device_id"] retain];
		_joinedRoomsAddStatement = [[_conn prepareStatement:
		    @"INSERT OR REPLACE INTO joined_rooms (\n"
		    @"    user_id, room_id\n"
		    @") VALUES (\n"
		    @"    $user_id, $room_id\n"
		    @")"] retain];
		_joinedRoomsRemoveStatement = [[_conn prepareStatement:
		    @"DELETE FROM joined_rooms\n"
		    @"WHERE user_id=$user_id AND room_id=$room_id"] retain];