forked from La_Bureautique/zeg1jeux
Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
|
c80f7171d1 | |
|
bfa50d3574 | |
|
291f23f514 |
|
@ -3,3 +3,4 @@ cache/
|
|||
tests/
|
||||
minelife.html
|
||||
vendors/keygen/__pycache__
|
||||
erreurs/
|
|
@ -44,6 +44,13 @@ class GchangeUser {
|
|||
}
|
||||
}
|
||||
|
||||
static public function constructVoidUser ($pubkey) {
|
||||
|
||||
$this->userGchangeId = $pubkey;
|
||||
|
||||
$this->userName = substr($this->userGchangeId, 0, 8);
|
||||
}
|
||||
|
||||
public function getUserGchangeId () {
|
||||
|
||||
return $this->userGchangeId;
|
||||
|
|
|
@ -62,7 +62,7 @@ class Jaklis {
|
|||
$cmd .= ' read';
|
||||
$cmd .= ' --number ' . $this->msgLimit;
|
||||
$cmd .= ' --json';
|
||||
|
||||
|
||||
$output=null;
|
||||
$result_code=null;
|
||||
exec($cmd, $output, $result_code);
|
||||
|
|
|
@ -81,7 +81,16 @@ class Messenger {
|
|||
|
||||
if (!isset($users[$penpalPubkey])) {
|
||||
|
||||
$this->users[$penpalPubkey] = $this->gchange->getUser($penpalPubkey);
|
||||
try {
|
||||
|
||||
$user = $this->gchange->getUser($penpalPubkey);
|
||||
|
||||
$this->users[$penpalPubkey] = $user;
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
$this->users[$penpalPubkey] = GchangeUser::constructVoidUser($penpalPubkey);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function getConversation ($penpalGchangeId) {
|
||||
|
|
|
@ -42,7 +42,14 @@ try {
|
|||
// echo '<pre>'; var_dump($msgOut); echo '</pre>';
|
||||
// die();
|
||||
|
||||
$messenger->addMessages($msgIn, $msgOut);
|
||||
try {
|
||||
|
||||
$messenger->addMessages($msgIn, $msgOut);
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// L'utilisateur {...} n'a été trouvé nulle part.
|
||||
}
|
||||
|
||||
// echo '<pre>'; var_dump($messenger->getConversations()); echo '</pre>';
|
||||
|
||||
|
|
Loading…
Reference in New Issue