diff --git a/src/common/config.py b/src/common/config.py
index 0ea4c845d..7411bd89d 100644
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -257,7 +257,7 @@ class Config:
return None
return self.__options[optname][OPT_VAL]
- def add_per(self, typename, name):
+ def add_per(self, typename, name): # per_group_of_option
if not self.__options_per_key.has_key(typename):
# print 'error: option %s doesn\'t exist' % (typename)
return -1
@@ -266,7 +266,7 @@ class Config:
opt[1][name] = copy.deepcopy(opt[0])
- def del_per(self, typename, name):
+ def del_per(self, typename, name): # per_group_of_option
if not self.__options_per_key.has_key(typename):
# print 'error: option %s doesn\'t exist' % (typename)
return -1
@@ -274,7 +274,7 @@ class Config:
opt = self.__options_per_key[typename]
del opt[1][name]
- def set_per(self, optname, key, subname, value):
+ def set_per(self, optname, key, subname, value): # per_group_of_option
if not self.__options_per_key.has_key(optname):
# print 'error: option %s doesn\'t exist' % (optname)
return -1
@@ -290,7 +290,7 @@ class Config:
subobj[OPT_VAL] = value
return 0
- def get_per(self, optname, key = None, subname = None):
+ def get_per(self, optname, key = None, subname = None): # per_group_of_option
if not self.__options_per_key.has_key(optname):
return None
dict = self.__options_per_key[optname][1]
diff --git a/src/gajim.py b/src/gajim.py
index 9a061ed56..1ff679d0c 100755
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -231,18 +231,33 @@ class Interface:
if not self.windows[account]['chats'].has_key(jid) and \
not self.queues[account].has_key(jid) and \
gajim.config.get('notify_on_online'):
- instance = dialogs.Popup_window(self, 'Contact Online', jid, \
- account)
- self.roster.popup_windows.append(instance)
+ show_notification = False
+ # check OUR status and if we allow notifications for that status
+ if gajim.config.get('autopopupaway'): # always notify
+ show_notification = True
+ elif gajim.connections[account].connected in (1, 2): #online or chat
+ show_notification = True
+ if show_notification:
+ instance = dialogs.Popup_window(self, 'Contact Online', jid, \
+ account)
+ self.roster.popup_windows.append(instance)
+
elif old_show > 1 and new_show < 2 and gajim.config.get_per( \
'soundevents', 'contact_disconnected', 'enabled'):
self.play_sound('contact_disconnected')
if not self.windows[account]['chats'].has_key(jid) and \
not self.queues[account].has_key(jid) and \
gajim.config.get('notify_on_offline'):
- instance = dialogs.Popup_window(self, 'Contact Offline', jid, \
- account)
- self.roster.popup_windows.append(instance)
+ show_notification = False
+ # check OUR status and if we allow notifications for that status
+ if gajim.config.get('autopopupaway'): # always notify
+ show_notification = True
+ elif gajim.connections[account].connected in (1, 2): #online or chat
+ show_notification = True
+ if show_notification:
+ instance = dialogs.Popup_window(self, 'Contact Offline', jid, \
+ account)
+ self.roster.popup_windows.append(instance)
elif self.windows[account]['gc'].has_key(ji):
#it is a groupchat presence
@@ -264,8 +279,15 @@ class Interface:
not self.queues[account].has_key(jid):
first = True
if gajim.config.get('notify_on_new_message'):
- instance = dialogs.Popup_window(self, 'New Message', jid, account)
- self.roster.popup_windows.append(instance)
+ show_notification = False
+ # check OUR status and if we allow notifications for that status
+ if gajim.config.get('autopopupaway'): # always show notification
+ show_notification = True
+ elif gajim.connections[account].connected in (1, 2): #online or chat
+ show_notification = True
+ if show_notification:
+ instance = dialogs.Popup_window(self, 'New Message', jid, account)
+ self.roster.popup_windows.append(instance)
self.roster.on_message(jid, array[1], array[2], account)
if gajim.config.get_per('soundevents', 'first_message_received', \
'enabled') and first:
diff --git a/src/gtkgui.glade b/src/gtkgui.glade
index 51b0870a2..5d7c2b74b 100644
--- a/src/gtkgui.glade
+++ b/src/gtkgui.glade
@@ -2828,7 +2828,7 @@
4
- 460
+ 465
410
Preferences
GTK_WINDOW_TOPLEVEL
@@ -10026,6 +10026,21 @@ send a chat message to
+
+
+
+
+
+
+
+