mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-10 01:16:12 +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>
|
||||
* @copyright Loic Blot 2014
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\AppInfo;
|
||||
|
||||
class FormatPhoneNumber {
|
||||
@ -46,14 +45,13 @@ class FormatPhoneNumber {
|
||||
$lpnrpl = '+49$2'; // replace with +49 -xx[x[x]]-123456
|
||||
|
||||
$tpn = trim($pn);
|
||||
$fpn = '';
|
||||
$xpn = '';
|
||||
if( preg_match('#^[\d\+].*#',$tpn)) { // start with digit or +
|
||||
$fpn = preg_replace($ignrxp, '', $tpn); // replace everything but digits/+ with ''
|
||||
$xpn = preg_replace($lpnrxp, $lpnrpl, $fpn); // replace local prenumbers
|
||||
$ypn = preg_replace($ipnrxp, '+$2', $xpn); // format to international coding +x[x[x]].....
|
||||
} else
|
||||
} else {
|
||||
$ypn = $tpn; // some SMS_adresses are strings
|
||||
}
|
||||
return $ypn;
|
||||
}
|
||||
}
|
||||
|
@ -146,8 +146,9 @@ class OcSmsApp extends App {
|
||||
$phoneNb = FormatPhoneNumber::formatPhoneNumber($rawPhone);
|
||||
self::$contacts[$phoneNb] = $contactName;
|
||||
// Inverted contacts
|
||||
if (!isset(self::$contactsInverted[$contactName]))
|
||||
if (!isset(self::$contactsInverted[$contactName])) {
|
||||
self::$contactsInverted[$contactName] = array();
|
||||
}
|
||||
array_push(self::$contactsInverted[$contactName], $phoneNb);
|
||||
}
|
||||
}
|
||||
|
@ -110,9 +110,10 @@ class SmsMapper extends Mapper {
|
||||
if(isset($phoneList[$fpn])){
|
||||
return $phoneList[$fpn];
|
||||
}
|
||||
else
|
||||
else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllMessagesForPhoneNumber ($userId, $phoneNumber, $minDate = 0) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user