Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php b/src/applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php
index b62a61113c..81138831d0 100644
--- a/src/applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php
+++ b/src/applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php
@@ -1,67 +1,67 @@
<?php
final class ConpherenceCreateThreadConduitAPIMethod
extends ConpherenceConduitAPIMethod {
public function getAPIMethodName() {
return 'conpherence.createthread';
}
public function getMethodDescription() {
return pht('Create a new conpherence thread.');
}
public function defineParamTypes() {
return array(
'title' => 'optional string',
'message' => 'required string',
'participantPHIDs' => 'required list<phids>',
);
}
public function defineReturnType() {
return 'nonempty dict';
}
public function defineErrorTypes() {
return array(
'ERR_EMPTY_PARTICIPANT_PHIDS' => pht(
'You must specify participant phids.'),
'ERR_EMPTY_MESSAGE' => pht(
'You must specify a message.'),
);
}
protected function execute(ConduitAPIRequest $request) {
$participant_phids = $request->getValue('participantPHIDs', array());
$message = $request->getValue('message');
$title = $request->getValue('title');
- list($errors, $conpherence) = ConpherenceEditor::createConpherence(
+ list($errors, $conpherence) = ConpherenceEditor::createThread(
$request->getUser(),
$participant_phids,
$title,
$message,
PhabricatorContentSource::newFromConduitRequest($request));
if ($errors) {
foreach ($errors as $error_code) {
switch ($error_code) {
case ConpherenceEditor::ERROR_EMPTY_MESSAGE:
throw new ConduitException('ERR_EMPTY_MESSAGE');
break;
case ConpherenceEditor::ERROR_EMPTY_PARTICIPANTS:
throw new ConduitException('ERR_EMPTY_PARTICIPANT_PHIDS');
break;
}
}
}
return array(
'conpherenceID' => $conpherence->getID(),
'conpherencePHID' => $conpherence->getPHID(),
'conpherenceURI' => $this->getConpherenceURI($conpherence),
);
}
}
diff --git a/src/applications/conpherence/controller/ConpherenceNewController.php b/src/applications/conpherence/controller/ConpherenceNewController.php
index f035b597b7..24e3c80785 100644
--- a/src/applications/conpherence/controller/ConpherenceNewController.php
+++ b/src/applications/conpherence/controller/ConpherenceNewController.php
@@ -1,108 +1,108 @@
<?php
final class ConpherenceNewController extends ConpherenceController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$title = pht('New Message');
$participants = array();
$participant_prefill = null;
$message = '';
$e_participants = null;
$e_message = null;
$errors = array();
// this comes from ajax requests from all over. should be a single phid.
if ($request->isFormPost()) {
$participants = $request->getArr('participants');
$message = $request->getStr('message');
- list($error_codes, $conpherence) = ConpherenceEditor::createConpherence(
+ list($error_codes, $conpherence) = ConpherenceEditor::createThread(
$user,
$participants,
$conpherence_title = null,
$message,
PhabricatorContentSource::newFromRequest($request));
if ($error_codes) {
foreach ($error_codes as $error_code) {
switch ($error_code) {
case ConpherenceEditor::ERROR_EMPTY_MESSAGE:
$e_message = pht('Required');
$errors[] = pht(
'You can not send an empty message.');
break;
case ConpherenceEditor::ERROR_EMPTY_PARTICIPANTS:
$e_participants = pht('Required');
$errors[] = pht(
'You must choose at least one recipient for your '.
'message.');
break;
}
}
} else {
$uri = $this->getApplicationURI($conpherence->getID());
return id(new AphrontRedirectResponse())
->setURI($uri);
}
} else {
$participant_prefill = $request->getStr('participant');
if ($participant_prefill) {
$participants[] = $participant_prefill;
}
}
$participant_handles = array();
if ($participants) {
$participant_handles = id(new PhabricatorHandleQuery())
->setViewer($user)
->withPHIDs($participants)
->execute();
}
$submit_uri = $this->getApplicationURI('new/');
$cancel_uri = $this->getApplicationURI();
// TODO - we can get a better cancel_uri once we get better at crazy
// ajax jonx T2086
if ($participant_prefill) {
$handle = $participant_handles[$participant_prefill];
$cancel_uri = $handle->getURI();
}
$dialog = id(new AphrontDialogView())
->setWidth(AphrontDialogView::WIDTH_FORM)
->setErrors($errors)
->setUser($user)
->setTitle($title)
->addCancelButton($cancel_uri)
->addSubmitButton(pht('Send Message'));
$form = id(new PHUIFormLayoutView())
->setUser($user)
->setFullWidth(true)
->appendChild(
id(new AphrontFormTokenizerControl())
->setName('participants')
->setValue($participant_handles)
->setUser($user)
->setDatasource(new PhabricatorPeopleDatasource())
->setLabel(pht('To'))
->setError($e_participants))
->appendChild(
id(new PhabricatorRemarkupControl())
->setUser($user)
->setName('message')
->setValue($message)
->setLabel(pht('Message'))
->setError($e_message));
$dialog->appendChild($form);
return id(new AphrontDialogResponse())->setDialog($dialog);
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jun 10, 3:32 PM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
140454
Default Alt Text
(6 KB)

Event Timeline