summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/roster.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/roster.py b/src/roster.py
index 5a068909..fc68278f 100644
--- a/src/roster.py
+++ b/src/roster.py
@@ -243,11 +243,14 @@ class Roster(object):
return
try:
f = open(path, 'w+', encoding='utf-8')
- f.writelines([i + "\n" for i in self.contacts])
+ f.writelines([str(i) + "\n" for i in self.contacts if self[i] and (self[i].subscription == "both" or self[i].ask)])
f.close()
return True
except IOError:
return
+ except OSError:
+ return
+
def exists(self, contact):
if not contact: