SMS Plugin show ignored too
This commit is contained in:
parent
9e2cb7d047
commit
95da55724e
|
@ -11,6 +11,7 @@ class Sms {
|
|||
boolean received = false;
|
||||
boolean sent = false;
|
||||
boolean processed = false;
|
||||
boolean ignored = false;
|
||||
|
||||
Sms(SmsMessage message) {
|
||||
phoneNumber = message.getOriginatingAddress();
|
||||
|
|
|
@ -59,7 +59,9 @@ public class SmsCommunicatorFragment extends SubscriberFragment {
|
|||
String logText = "";
|
||||
for (int x = start; x < SmsCommunicatorPlugin.getPlugin().messages.size(); x++) {
|
||||
Sms sms = SmsCommunicatorPlugin.getPlugin().messages.get(x);
|
||||
if (sms.received) {
|
||||
if (sms.ignored) {
|
||||
logText += DateUtil.timeString(sms.date) + " <<< " + "░ " + sms.phoneNumber + " <b>" + sms.text + "</b><br>";
|
||||
} else if (sms.received) {
|
||||
logText += DateUtil.timeString(sms.date) + " <<< " + (sms.processed ? "● " : "○ ") + sms.phoneNumber + " <b>" + sms.text + "</b><br>";
|
||||
} else if (sms.sent) {
|
||||
logText += DateUtil.timeString(sms.date) + " >>> " + (sms.processed ? "● " : "○ ") + sms.phoneNumber + " <b>" + sms.text + "</b><br>";
|
||||
|
|
|
@ -142,6 +142,9 @@ public class SmsCommunicatorPlugin extends PluginBase {
|
|||
}
|
||||
if (!isAllowedNumber(receivedSms.phoneNumber)) {
|
||||
log.debug("Ignoring SMS from: " + receivedSms.phoneNumber + ". Sender not allowed");
|
||||
receivedSms.ignored = true;
|
||||
messages.add(receivedSms);
|
||||
MainApp.bus().post(new EventSmsCommunicatorUpdateGui());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue