Added callsign blacklist to complement the whitelist
This commit is contained in:
parent
11bced9372
commit
386c03ec6d
@ -590,6 +590,7 @@ private:
|
|||||||
QString my_grid_;
|
QString my_grid_;
|
||||||
QStringList my_groups_;
|
QStringList my_groups_;
|
||||||
QStringList auto_whitelist_;
|
QStringList auto_whitelist_;
|
||||||
|
QStringList auto_blacklist_;
|
||||||
QString my_qth_;
|
QString my_qth_;
|
||||||
QString cq_;
|
QString cq_;
|
||||||
QString reply_;
|
QString reply_;
|
||||||
@ -971,6 +972,10 @@ QSet<QString> Configuration::auto_whitelist() const {
|
|||||||
return QSet<QString>::fromList(m_->auto_whitelist_);
|
return QSet<QString>::fromList(m_->auto_whitelist_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSet<QString> Configuration::auto_blacklist() const {
|
||||||
|
return QSet<QString>::fromList(m_->auto_blacklist_);
|
||||||
|
}
|
||||||
|
|
||||||
QString Configuration::my_qth() const
|
QString Configuration::my_qth() const
|
||||||
{
|
{
|
||||||
auto qth = m_->my_qth_;
|
auto qth = m_->my_qth_;
|
||||||
@ -1359,6 +1364,7 @@ void Configuration::impl::initialize_models ()
|
|||||||
ui_->activity_aging_spin_box->setValue(activity_aging_);
|
ui_->activity_aging_spin_box->setValue(activity_aging_);
|
||||||
ui_->groups_line_edit->setText(my_groups_.join(", "));
|
ui_->groups_line_edit->setText(my_groups_.join(", "));
|
||||||
ui_->auto_whitelist_line_edit->setText(auto_whitelist_.join(", "));
|
ui_->auto_whitelist_line_edit->setText(auto_whitelist_.join(", "));
|
||||||
|
ui_->auto_blacklist_line_edit->setText(auto_blacklist_.join(", "));
|
||||||
ui_->qth_message_line_edit->setText (my_qth_.toUpper());
|
ui_->qth_message_line_edit->setText (my_qth_.toUpper());
|
||||||
ui_->cq_message_line_edit->setText(cq_.toUpper());
|
ui_->cq_message_line_edit->setText(cq_.toUpper());
|
||||||
ui_->reply_message_line_edit->setText (reply_.toUpper());
|
ui_->reply_message_line_edit->setText (reply_.toUpper());
|
||||||
@ -1503,6 +1509,7 @@ void Configuration::impl::read_settings ()
|
|||||||
my_grid_ = settings_->value ("MyGrid", QString {}).toString ();
|
my_grid_ = settings_->value ("MyGrid", QString {}).toString ();
|
||||||
my_groups_ = settings_->value("MyGroups", QStringList{}).toStringList();
|
my_groups_ = settings_->value("MyGroups", QStringList{}).toStringList();
|
||||||
auto_whitelist_ = settings_->value("AutoWhitelist", QStringList{}).toStringList();
|
auto_whitelist_ = settings_->value("AutoWhitelist", QStringList{}).toStringList();
|
||||||
|
auto_blacklist_ = settings_->value("AutoBlacklist", QStringList{}).toStringList();
|
||||||
callsign_aging_ = settings_->value ("CallsignAging", 0).toInt ();
|
callsign_aging_ = settings_->value ("CallsignAging", 0).toInt ();
|
||||||
activity_aging_ = settings_->value ("ActivityAging", 2).toInt ();
|
activity_aging_ = settings_->value ("ActivityAging", 2).toInt ();
|
||||||
my_qth_ = settings_->value("MyQTH", QString {}).toString();
|
my_qth_ = settings_->value("MyQTH", QString {}).toString();
|
||||||
@ -1763,6 +1770,7 @@ void Configuration::impl::write_settings ()
|
|||||||
settings_->setValue ("MyGrid", my_grid_);
|
settings_->setValue ("MyGrid", my_grid_);
|
||||||
settings_->setValue ("MyGroups", my_groups_);
|
settings_->setValue ("MyGroups", my_groups_);
|
||||||
settings_->setValue ("AutoWhitelist", auto_whitelist_);
|
settings_->setValue ("AutoWhitelist", auto_whitelist_);
|
||||||
|
settings_->setValue ("AutoBlacklist", auto_blacklist_);
|
||||||
settings_->setValue ("MyQTH", my_qth_);
|
settings_->setValue ("MyQTH", my_qth_);
|
||||||
settings_->setValue ("CQMessage", cq_);
|
settings_->setValue ("CQMessage", cq_);
|
||||||
settings_->setValue ("Reply", reply_);
|
settings_->setValue ("Reply", reply_);
|
||||||
@ -2354,6 +2362,7 @@ void Configuration::impl::accept ()
|
|||||||
my_grid_ = ui_->grid_line_edit->text ().toUpper();
|
my_grid_ = ui_->grid_line_edit->text ().toUpper();
|
||||||
my_groups_ = splitGroups(ui_->groups_line_edit->text().toUpper().trimmed(), true);
|
my_groups_ = splitGroups(ui_->groups_line_edit->text().toUpper().trimmed(), true);
|
||||||
auto_whitelist_ = splitCalls(ui_->auto_whitelist_line_edit->text().toUpper().trimmed());
|
auto_whitelist_ = splitCalls(ui_->auto_whitelist_line_edit->text().toUpper().trimmed());
|
||||||
|
auto_blacklist_ = splitCalls(ui_->auto_blacklist_line_edit->text().toUpper().trimmed());
|
||||||
cq_ = ui_->cq_message_line_edit->text().toUpper();
|
cq_ = ui_->cq_message_line_edit->text().toUpper();
|
||||||
reply_ = ui_->reply_message_line_edit->text().toUpper();
|
reply_ = ui_->reply_message_line_edit->text().toUpper();
|
||||||
my_qth_ = ui_->qth_message_line_edit->text().toUpper();
|
my_qth_ = ui_->qth_message_line_edit->text().toUpper();
|
||||||
|
@ -101,6 +101,7 @@ public:
|
|||||||
void addGroup(QString const &group);
|
void addGroup(QString const &group);
|
||||||
void removeGroup(QString const &group);
|
void removeGroup(QString const &group);
|
||||||
QSet<QString> auto_whitelist() const;
|
QSet<QString> auto_whitelist() const;
|
||||||
|
QSet<QString> auto_blacklist() const;
|
||||||
int activity_aging() const;
|
int activity_aging() const;
|
||||||
int callsign_aging() const;
|
int callsign_aging() const;
|
||||||
QString my_qth () const;
|
QString my_qth () const;
|
||||||
|
@ -277,9 +277,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-133</y>
|
<y>0</y>
|
||||||
<width>724</width>
|
<width>724</width>
|
||||||
<height>586</height>
|
<height>617</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_26">
|
<layout class="QVBoxLayout" name="verticalLayout_26">
|
||||||
@ -567,6 +567,16 @@ text message.</string>
|
|||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLineEdit" name="auto_whitelist_line_edit"/>
|
<widget class="QLineEdit" name="auto_whitelist_line_edit"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_15">
|
||||||
|
<property name="text">
|
||||||
|
<string>Never autoreply to these callsigns (comma separated):</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLineEdit" name="auto_blacklist_line_edit"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -9730,6 +9730,13 @@ void MainWindow::processCommandActivity() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we'll never reply to a blacklisted callsign or base callsign
|
||||||
|
auto blacklist = m_config.auto_blacklist();
|
||||||
|
if(!blacklist.isEmpty() && (blacklist.contains(d.from) || blacklist.contains(Radio::base_callsign(d.from)))){
|
||||||
|
qDebug() << "skipping command for blacklist" << d.from;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// if this is an allcall, check to make sure we haven't replied to their allcall recently (in the past ten minutes)
|
// if this is an allcall, check to make sure we haven't replied to their allcall recently (in the past ten minutes)
|
||||||
// that way we never get spammed by allcalls at too high of a frequency
|
// that way we never get spammed by allcalls at too high of a frequency
|
||||||
if (isAllCall && m_txAllcallCommandCache.contains(d.from) && m_txAllcallCommandCache[d.from]->secsTo(now) / 60 < 10) {
|
if (isAllCall && m_txAllcallCommandCache.contains(d.from) && m_txAllcallCommandCache[d.from]->secsTo(now) / 60 < 10) {
|
||||||
|
Loading…
Reference in New Issue
Block a user