mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-10 17:36:21 +00:00
changed tabs and braces
modified: appinfo/formatphonenumber.php modified: appinfo/ocsmsapp.php modified: controller/smscontroller.php modified: db/smsmapper.php
This commit is contained in:
parent
405ee9af6f
commit
6816a92b89
@ -8,7 +8,6 @@
|
|||||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||||
* @copyright Loic Blot 2014
|
* @copyright Loic Blot 2014
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\OcSms\AppInfo;
|
namespace OCA\OcSms\AppInfo;
|
||||||
|
|
||||||
class FormatPhoneNumber {
|
class FormatPhoneNumber {
|
||||||
@ -46,14 +45,13 @@ class FormatPhoneNumber {
|
|||||||
$lpnrpl = '+49$2'; // replace with +49 -xx[x[x]]-123456
|
$lpnrpl = '+49$2'; // replace with +49 -xx[x[x]]-123456
|
||||||
|
|
||||||
$tpn = trim($pn);
|
$tpn = trim($pn);
|
||||||
$fpn = '';
|
|
||||||
$xpn = '';
|
|
||||||
if( preg_match('#^[\d\+].*#',$tpn)) { // start with digit or +
|
if( preg_match('#^[\d\+].*#',$tpn)) { // start with digit or +
|
||||||
$fpn = preg_replace($ignrxp, '', $tpn); // replace everything but digits/+ with ''
|
$fpn = preg_replace($ignrxp, '', $tpn); // replace everything but digits/+ with ''
|
||||||
$xpn = preg_replace($lpnrxp, $lpnrpl, $fpn); // replace local prenumbers
|
$xpn = preg_replace($lpnrxp, $lpnrpl, $fpn); // replace local prenumbers
|
||||||
$ypn = preg_replace($ipnrxp, '+$2', $xpn); // format to international coding +x[x[x]].....
|
$ypn = preg_replace($ipnrxp, '+$2', $xpn); // format to international coding +x[x[x]].....
|
||||||
} else
|
} else {
|
||||||
$ypn = $tpn; // some SMS_adresses are strings
|
$ypn = $tpn; // some SMS_adresses are strings
|
||||||
|
}
|
||||||
return $ypn;
|
return $ypn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,8 +146,9 @@ class OcSmsApp extends App {
|
|||||||
$phoneNb = FormatPhoneNumber::formatPhoneNumber($rawPhone);
|
$phoneNb = FormatPhoneNumber::formatPhoneNumber($rawPhone);
|
||||||
self::$contacts[$phoneNb] = $contactName;
|
self::$contacts[$phoneNb] = $contactName;
|
||||||
// Inverted contacts
|
// Inverted contacts
|
||||||
if (!isset(self::$contactsInverted[$contactName]))
|
if (!isset(self::$contactsInverted[$contactName])) {
|
||||||
self::$contactsInverted[$contactName] = array();
|
self::$contactsInverted[$contactName] = array();
|
||||||
|
}
|
||||||
array_push(self::$contactsInverted[$contactName], $phoneNb);
|
array_push(self::$contactsInverted[$contactName], $phoneNb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,9 +110,10 @@ class SmsMapper extends Mapper {
|
|||||||
if(isset($phoneList[$fpn])){
|
if(isset($phoneList[$fpn])){
|
||||||
return $phoneList[$fpn];
|
return $phoneList[$fpn];
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getAllMessagesForPhoneNumber ($userId, $phoneNumber, $minDate = 0) {
|
public function getAllMessagesForPhoneNumber ($userId, $phoneNumber, $minDate = 0) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user