Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Add a user directory #2252
Conversation
erikjohnston
added some commits
May 31, 2017
erikjohnston
assigned
NegativeMjark
May 31, 2017
| + None if the field in the events either both match `public_value` o | ||
| + neither do, i.e. there has been no change. | ||
| + True if it didnt match `public_value` but now does | ||
| + Falsse if it did match `public_value` but now doesn't |
| + `shared` to `world_readable` (`public_value`). | ||
| + | ||
| + Returns: | ||
| + None if the field in the events either both match `public_value` o |
| + defer.returnValue(None) | ||
| + | ||
| + prev_hist_vis = None | ||
| + hist_vis = None |
| + if change: | ||
| + yield self._handle_new_user(room_id, user_id, profile) | ||
| + else: | ||
| + yield self._handle_remove_user(room_id, user_id) |
NegativeMjark
May 31, 2017
Contributor
It looks like lines 204-221 are duplicates of 172-197. Maybe lift them into a function?
erikjohnston
added some commits
May 31, 2017
| + avatar_url TEXT | ||
| +); | ||
| + | ||
| +CREATE INDEX user_directory_room_idx ON user_directory(room_id); |
| + WHERE stream_id > ? | ||
| + GROUP BY stream_id | ||
| + ORDER BY stream_id ASC | ||
| + LIMIT 100 |
erikjohnston
added some commits
May 31, 2017
| + | ||
| + Returns: | ||
| + None if the field in the events either both match `public_value` | ||
| + neither do, i.e. there has been no change. |
| + elif value != public_value and prev_value == public_value: | ||
| + defer.returnValue(False) | ||
| + else: | ||
| + defer.returnValue(None) |
NegativeMjark
Jun 1, 2017
Contributor
You could write this as:
old_value_is_public = prev_value == public_value
new_value_is_public = value == public_value
if old_value_is_public == new_value_is_public:
defer.returnValue(None)
else:
defer.returnValue(new_value_is_public)I'm not sure if it is clearer or not.
| + prev_value = prev_event.content.get(key_name, None) | ||
| + | ||
| + if event: | ||
| + value = event.content.get(key_name, None) |
erikjohnston
added some commits
Jun 1, 2017
NegativeMjark
approved these changes
Jun 1, 2017
Other than the possibly spurious test failures LGTM?
erikjohnston
added some commits
Jun 1, 2017
erikjohnston
merged commit 87e5e05
into
develop
Jun 1, 2017
8 checks passed
Sytest Dendron (Commit)
Build #2241 origin/erikj/user_dir succeeded in 9 min 31 sec
Details
Sytest Dendron (Merged PR)
Build finished.
Details
Sytest Postgres (Commit)
Build #3076 origin/erikj/user_dir succeeded in 8 min 16 sec
Details
Sytest Postgres (Merged PR)
Build finished.
Details
Sytest SQLite (Commit)
Build #3148 origin/erikj/user_dir succeeded in 1 min 34 sec
Details
Sytest SQLite (Merged PR)
Build finished.
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
continuous-integration/travis-ci/push
The Travis CI build passed
Details
erikjohnston
referenced this pull request
in vector-im/riot-web
Jun 1, 2017
Closed
Optional per-HS user/people directory. #2930
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
erikjohnston commentedMay 31, 2017
No description provided.