зеркало из https://github.com/mozilla/pjs.git
Bug 736697 - Part 1: Remove SMS-SUBMIT-only property from SMS-DELIVER. r=philikon
This commit is contained in:
Родитель
e89ca09f92
Коммит
5567738301
|
@ -2790,10 +2790,8 @@ let GsmPDUHelper = {
|
||||||
// An empty message object. This gets filled below and then returned.
|
// An empty message object. This gets filled below and then returned.
|
||||||
let msg = {
|
let msg = {
|
||||||
SMSC: null,
|
SMSC: null,
|
||||||
reference: null,
|
|
||||||
sender: null,
|
sender: null,
|
||||||
body: null,
|
body: null,
|
||||||
validity: null,
|
|
||||||
timestamp: null
|
timestamp: null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2814,12 +2812,6 @@ let GsmPDUHelper = {
|
||||||
// User data header indicator
|
// User data header indicator
|
||||||
let hasUserDataHeader = firstOctet & PDU_UDHI;
|
let hasUserDataHeader = firstOctet & PDU_UDHI;
|
||||||
|
|
||||||
// if the sms is of SMS-SUBMIT type it would contain a TP-MR
|
|
||||||
let isSmsSubmit = firstOctet & PDU_MTI_SMS_SUBMIT;
|
|
||||||
if (isSmsSubmit) {
|
|
||||||
msg.reference = this.readHexOctet(); // TP-Message-Reference
|
|
||||||
}
|
|
||||||
|
|
||||||
// - Sender Address info -
|
// - Sender Address info -
|
||||||
// Address length
|
// Address length
|
||||||
let senderAddressLength = this.readHexOctet();
|
let senderAddressLength = this.readHexOctet();
|
||||||
|
@ -2848,24 +2840,6 @@ let GsmPDUHelper = {
|
||||||
// - TP-Data-Coding-Scheme -
|
// - TP-Data-Coding-Scheme -
|
||||||
let dataCodingScheme = this.readHexOctet();
|
let dataCodingScheme = this.readHexOctet();
|
||||||
|
|
||||||
// SMS of SMS-SUBMIT type contains a TP-Service-Center-Time-Stamp field
|
|
||||||
// SMS of SMS-DELIVER type contains a TP-Validity-Period octet
|
|
||||||
if (isSmsSubmit) {
|
|
||||||
// - TP-Validity-Period -
|
|
||||||
// The Validity Period octet is optional. Depends on the SMS-SUBMIT
|
|
||||||
// first octet
|
|
||||||
// Validity Period Format. Bit4 and Bit3 specify the TP-VP field
|
|
||||||
// according to this table:
|
|
||||||
// bit4 bit3
|
|
||||||
// 0 0 : TP-VP field not present
|
|
||||||
// 1 0 : TP-VP field present. Relative format (one octet)
|
|
||||||
// 0 1 : TP-VP field present. Enhanced format (7 octets)
|
|
||||||
// 1 1 : TP-VP field present. Absolute format (7 octets)
|
|
||||||
if (firstOctet & (PDU_VPF_ABSOLUTE | PDU_VPF_RELATIVE | PDU_VPF_ENHANCED)) {
|
|
||||||
msg.validity = this.readHexOctet();
|
|
||||||
}
|
|
||||||
//TODO: check validity period
|
|
||||||
} else {
|
|
||||||
// - TP-Service-Center-Time-Stamp -
|
// - TP-Service-Center-Time-Stamp -
|
||||||
let year = this.readSwappedNibbleBCD(1) + PDU_TIMESTAMP_YEAR_OFFSET;
|
let year = this.readSwappedNibbleBCD(1) + PDU_TIMESTAMP_YEAR_OFFSET;
|
||||||
let month = this.readSwappedNibbleBCD(1) - 1;
|
let month = this.readSwappedNibbleBCD(1) - 1;
|
||||||
|
@ -2884,7 +2858,6 @@ let GsmPDUHelper = {
|
||||||
} else {
|
} else {
|
||||||
msg.timestamp += tzOffset;
|
msg.timestamp += tzOffset;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// - TP-User-Data-Length -
|
// - TP-User-Data-Length -
|
||||||
let userDataLength = this.readHexOctet();
|
let userDataLength = this.readHexOctet();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче