1
0
mirror of https://github.com/flarum/core.git synced 2025-10-11 23:14:29 +02:00

Show post IP address in meta dropdown. closes #956 closes #657

This commit is contained in:
Davis
2016-05-21 22:02:42 +09:30
committed by Toby Zerner
parent 38c15c5a08
commit 909f52522b
9 changed files with 36 additions and 7 deletions

View File

@@ -32,9 +32,10 @@ class StartDiscussion
* @param User $actor The user authoring the discussion.
* @param array $data The discussion attributes.
*/
public function __construct(User $actor, array $data)
public function __construct(User $actor, array $data, $ipAddress)
{
$this->actor = $actor;
$this->data = $data;
$this->ipAddress = $ipAddress;
}
}

View File

@@ -55,6 +55,7 @@ class StartDiscussionHandler
{
$actor = $command->actor;
$data = $command->data;
$ipAddress = $command->ipAddress;
$this->assertCan($actor, 'startDiscussion');
@@ -79,7 +80,7 @@ class StartDiscussionHandler
// We will do this by running the PostReply command.
try {
$post = $this->bus->dispatch(
new PostReply($discussion->id, $actor, $data)
new PostReply($discussion->id, $actor, $data, $ipAddress)
);
} catch (Exception $e) {
$discussion->delete();