{"action":"created","issue":{"url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine/issues/615","repository_url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine","labels_url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine/issues/615/labels{/name}","comments_url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine/issues/615/comments","events_url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine/issues/615/events","html_url":"https://github.com/wireapp/wire-ios-sync-engine/pull/615","id":270364180,"number":615,"title":"always generate system message for self member join event","user":{"login":"johnxnguyen","id":28632506,"avatar_url":"https://avatars2.githubusercontent.com/u/28632506?v=4","gravatar_id":"","url":"https://api.github.com/users/johnxnguyen","html_url":"https://github.com/johnxnguyen","followers_url":"https://api.github.com/users/johnxnguyen/followers","following_url":"https://api.github.com/users/johnxnguyen/following{/other_user}","gists_url":"https://api.github.com/users/johnxnguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/johnxnguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnxnguyen/subscriptions","organizations_url":"https://api.github.com/users/johnxnguyen/orgs","repos_url":"https://api.github.com/users/johnxnguyen/repos","events_url":"https://api.github.com/users/johnxnguyen/events{/privacy}","received_events_url":"https://api.github.com/users/johnxnguyen/received_events","type":"User","site_admin":false},"labels":[{"id":417543034,"url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine/labels/DO%20NOT%20MERGE","name":"DO NOT MERGE","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-01T16:19:26Z","updated_at":"2017-11-01T16:34:00Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine/pulls/615","html_url":"https://github.com/wireapp/wire-ios-sync-engine/pull/615","diff_url":"https://github.com/wireapp/wire-ios-sync-engine/pull/615.diff","patch_url":"https://github.com/wireapp/wire-ios-sync-engine/pull/615.patch"},"body":"## Problem\r\nThe self user was not generating system messages and notifications when they were added to a group conversation.\r\n\r\n## Reason\r\nA conversation’s `isSelfAnActiveMember` flag defaults to true, thus if the self user is added to a group, the `users` set will always be a subset of `conversation.activeParticipants` and consequently the check would fail.\r\n\r\n## Solution\r\nIf the `users` set contains the self user, pass the check.\r\n\r\n### NOTE\r\nIf the self user added a person to a group, the `memberJoin` event would be fired twice, first in response to the POST, second when decoding from the notification stream. This would then create double system messages (the reason why the original check is there in the first place). However, since the self user can never add him/herself to a group conversation, it is safe to assume that the user was added externally, meaning we would only get the event once.\r\n\r\n- [ ] depends on: https://github.com/wireapp/wire-ios-data-model/pull/390"},"comment":{"url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine/issues/comments/341161186","html_url":"https://github.com/wireapp/wire-ios-sync-engine/pull/615#issuecomment-341161186","issue_url":"https://api.github.com/repos/wireapp/wire-ios-sync-engine/issues/615","id":341161186,"user":{"login":"johnxnguyen","id":28632506,"avatar_url":"https://avatars2.githubusercontent.com/u/28632506?v=4","gravatar_id":"","url":"https://api.github.com/users/johnxnguyen","html_url":"https://github.com/johnxnguyen","followers_url":"https://api.github.com/users/johnxnguyen/followers","following_url":"https://api.github.com/users/johnxnguyen/following{/other_user}","gists_url":"https://api.github.com/users/johnxnguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/johnxnguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnxnguyen/subscriptions","organizations_url":"https://api.github.com/users/johnxnguyen/orgs","repos_url":"https://api.github.com/users/johnxnguyen/repos","events_url":"https://api.github.com/users/johnxnguyen/events{/privacy}","received_events_url":"https://api.github.com/users/johnxnguyen/received_events","type":"User","site_admin":false},"created_at":"2017-11-01T16:34:00Z","updated_at":"2017-11-01T16:34:00Z","author_association":"CONTRIBUTOR","body":"I still need to fix a test"}}
{"actor":{"display_login":"johnxnguyen"}}