Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
abika committed Oct 17, 2016
2 parents fe1cdb8 + 12afac8 commit 59855e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/kontalk/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ public boolean addToRoster(JID jid, String name) {
return false;
}

if (!jid.isValid()) {
LOGGER.warning("invalid JID: " + jid);
return false;
}

try {
// also sends presence subscription request
Roster.getInstanceFor(mConn).createEntry(jid.string(), name,
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/kontalk/system/Control.java
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,11 @@ private void addToRoster(Contact contact) {
if (contact.isMe())
return;

if (contact.isDeleted()) {
LOGGER.warning("you don't want to add a deleted contact: " + contact);
return;
}

String contactName = contact.getName();
String rosterName =
Config.getInstance().getBoolean(Config.NET_SEND_ROSTER_NAME) &&
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/kontalk/view/Notifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ public void optionSelected(NotificationOption option) {
switch (option) {
case yes :
mView.getControl().deleteContact(contact);
break;
case reset:
mView.getControl().createRosterEntry(contact);
break;
}
}
@Override
Expand Down

0 comments on commit 59855e5

Please sign in to comment.