- $user = User::staticGet('id', $notice->profile_id);
- if (!empty($user)) { // it's a remote notice
- if (!$this->validated($user)) {
- $msg = _m("You must validate your email address before posting.");
- throw new ClientException($msg);
- }
+ $author = $notice->getProfile();
+ if (!$author->isLocal()) {
+ // remote notice
+ return true;
+ }
+ $user = $author->getUser();
+ if (!$this->validated($user)) {
+ // TRANS: Client exception thrown when trying to post notices before validating an e-mail address.
+ $msg = _m('You must validate your email address before posting.');
+ throw new ClientException($msg);