1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-20 12:52:58 +00:00

Register conversations & add configMapper to smsmapper to use the phone number formatter

This commit is contained in:
Loic Blot
2018-05-17 13:02:03 +02:00
parent ed380fd09e
commit 68971b1d33
3 changed files with 16 additions and 10 deletions
+8 -5
View File
@@ -33,10 +33,12 @@ class SmsMapper extends Mapper {
6 => "queued"
);
private $convStateMapper;
private $configMapper;
public function __construct (IDBConnection $db, ConversationStateMapper $cmapper) {
public function __construct (IDBConnection $db, ConversationStateMapper $cmapper, ConfigMapper $configMapper) {
parent::__construct($db, 'ocsms_smsdatas');
$this->convStateMapper = $cmapper;
$this->configMapper = $configMapper;
}
public function getAllIds ($userId) {
@@ -379,12 +381,13 @@ class SmsMapper extends Mapper {
(int) $sms["type"]
));
/*
$conversation = $this->getConversationForUserAndPhone($userId, $sms["address"]);
$configuredCountry = $this->configMapper->getCountry();
$fmtPhoneNumber = PhoneNumberFormatter::format($configuredCountry, $sms["address"]);
$conversation = $this->getConversationForUserAndPhone($userId, $fmtPhoneNumber);
if ($conversation === null) {
$this->registerConversation($userId, $sms["address"]);
$this->registerConversation($userId, $fmtPhoneNumber);
}
*/
}
$this->db->commit();