{"action":"created","issue":{"url":"https://api.github.com/repos/futurechris/punpals/issues/59","repository_url":"https://api.github.com/repos/futurechris/punpals","labels_url":"https://api.github.com/repos/futurechris/punpals/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/futurechris/punpals/issues/59/comments","events_url":"https://api.github.com/repos/futurechris/punpals/issues/59/events","html_url":"https://github.com/futurechris/punpals/issues/59","id":127547499,"number":59,"title":"Avatars don't work when users are logged off. Hah.","user":{"login":"futurechris","id":6239511,"avatar_url":"https://avatars.githubusercontent.com/u/6239511?v=3","gravatar_id":"","url":"https://api.github.com/users/futurechris","html_url":"https://github.com/futurechris","followers_url":"https://api.github.com/users/futurechris/followers","following_url":"https://api.github.com/users/futurechris/following{/other_user}","gists_url":"https://api.github.com/users/futurechris/gists{/gist_id}","starred_url":"https://api.github.com/users/futurechris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futurechris/subscriptions","organizations_url":"https://api.github.com/users/futurechris/orgs","repos_url":"https://api.github.com/users/futurechris/repos","events_url":"https://api.github.com/users/futurechris/events{/privacy}","received_events_url":"https://api.github.com/users/futurechris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/futurechris/punpals/milestones/2","html_url":"https://github.com/futurechris/punpals/milestones/MVP%200","labels_url":"https://api.github.com/repos/futurechris/punpals/milestones/2/labels","id":1247271,"number":2,"title":"MVP 0","description":"","creator":{"login":"hannahkane","id":8389648,"avatar_url":"https://avatars.githubusercontent.com/u/8389648?v=3","gravatar_id":"","url":"https://api.github.com/users/hannahkane","html_url":"https://github.com/hannahkane","followers_url":"https://api.github.com/users/hannahkane/followers","following_url":"https://api.github.com/users/hannahkane/following{/other_user}","gists_url":"https://api.github.com/users/hannahkane/gists{/gist_id}","starred_url":"https://api.github.com/users/hannahkane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannahkane/subscriptions","organizations_url":"https://api.github.com/users/hannahkane/orgs","repos_url":"https://api.github.com/users/hannahkane/repos","events_url":"https://api.github.com/users/hannahkane/events{/privacy}","received_events_url":"https://api.github.com/users/hannahkane/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":25,"state":"open","created_at":"2015-08-09T20:21:59Z","updated_at":"2016-02-01T20:42:17Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-01-19T21:52:13Z","updated_at":"2016-02-24T01:50:58Z","closed_at":null,"body":"Avatar code doesn't work when the users are logged off (i.e. if I log off, Chris Mills-Price posts go back to the default user icon). Wild. That’s going to take some time to figure out I bet.\r\n\r\nMight need to return to the idea of storing avatars in the db, but might be something to do with behavior of Meteor.users()"},"comment":{"url":"https://api.github.com/repos/futurechris/punpals/issues/comments/188006071","html_url":"https://github.com/futurechris/punpals/issues/59#issuecomment-188006071","issue_url":"https://api.github.com/repos/futurechris/punpals/issues/59","id":188006071,"user":{"login":"futurechris","id":6239511,"avatar_url":"https://avatars.githubusercontent.com/u/6239511?v=3","gravatar_id":"","url":"https://api.github.com/users/futurechris","html_url":"https://github.com/futurechris","followers_url":"https://api.github.com/users/futurechris/followers","following_url":"https://api.github.com/users/futurechris/following{/other_user}","gists_url":"https://api.github.com/users/futurechris/gists{/gist_id}","starred_url":"https://api.github.com/users/futurechris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futurechris/subscriptions","organizations_url":"https://api.github.com/users/futurechris/orgs","repos_url":"https://api.github.com/users/futurechris/repos","events_url":"https://api.github.com/users/futurechris/events{/privacy}","received_events_url":"https://api.github.com/users/futurechris/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T01:50:58Z","updated_at":"2016-02-24T01:50:58Z","body":"OK, so looks like the basic dealio here is that we only publish the current user’s .profile stuff. This is why we lose the avatars when the user logs out.\r\n\r\nFixing this should be application of this (from http://docs.meteor.com/#/full/meteor_users )\r\n\r\nBy default, the current user's username, emails and profile are published to the client. You can publish additional fields for the current user with:\r\n\r\n```\r\n// server\r\nMeteor.publish(\"userData\", function () {\r\n  if (this.userId) {\r\n    return Meteor.users.find({_id: this.userId},\r\n                             {fields: {'other': 1, 'things': 1}});\r\n  } else {\r\n    this.ready();\r\n  }\r\n});\r\n\r\n// client\r\nMeteor.subscribe(\"userData\");\r\n```\r\n"}}