Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
35a9cf5d
Commit
35a9cf5d
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
coding standards
parent
b4a645e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/notify.py
+11
-11
11 additions, 11 deletions
src/notify.py
with
11 additions
and
11 deletions
src/notify.py
+
11
−
11
View file @
35a9cf5d
...
...
@@ -57,7 +57,7 @@ try:
except
:
USER_HAS_GROWL
=
False
def
get_show_in_roster
(
event
,
account
,
contact
,
session
=
None
):
def
get_show_in_roster
(
event
,
account
,
contact
,
session
=
None
):
'''
Return True if this event must be shown in roster, else False
'''
if
event
==
'
gc_message_received
'
:
return
True
...
...
@@ -134,7 +134,7 @@ def get_advanced_notification(event, account, contact):
num
+=
1
notif
=
gajim
.
config
.
get_per
(
'
notifications
'
,
str
(
num
))
def
notify
(
event
,
jid
,
account
,
parameters
,
advanced_notif_num
=
None
):
def
notify
(
event
,
jid
,
account
,
parameters
,
advanced_notif_num
=
None
):
'''
Check what type of notifications we want, depending on basic
and the advanced configuration of notifications and do these notifications;
advanced_notif_num holds the number of the first (top most) advanced
...
...
@@ -236,7 +236,7 @@ def notify(event, jid, account, parameters, advanced_notif_num = None):
if
status_message
:
text
=
text
+
"
:
"
+
status_message
popup
(
_
(
'
Contact Changed Status
'
),
jid
,
account
,
path_to_image
=
path
,
title
=
title
,
text
=
text
)
path_to_image
=
path
,
title
=
title
,
text
=
text
)
elif
event
==
'
contact_connected
'
:
title
=
_
(
'
%(nickname)s Signed In
'
)
%
\
{
'
nickname
'
:
gajim
.
get_name_from_jid
(
account
,
jid
)}
...
...
@@ -244,7 +244,7 @@ def notify(event, jid, account, parameters, advanced_notif_num = None):
if
status_message
:
text
=
status_message
popup
(
_
(
'
Contact Signed In
'
),
jid
,
account
,
path_to_image
=
path
,
title
=
title
,
text
=
text
)
path_to_image
=
path
,
title
=
title
,
text
=
text
)
elif
event
==
'
contact_disconnected
'
:
title
=
_
(
'
%(nickname)s Signed Out
'
)
%
\
{
'
nickname
'
:
gajim
.
get_name_from_jid
(
account
,
jid
)}
...
...
@@ -252,7 +252,7 @@ def notify(event, jid, account, parameters, advanced_notif_num = None):
if
status_message
:
text
=
status_message
popup
(
_
(
'
Contact Signed Out
'
),
jid
,
account
,
path_to_image
=
path
,
title
=
title
,
text
=
text
)
path_to_image
=
path
,
title
=
title
,
text
=
text
)
elif
event
==
'
new_message
'
:
if
message_type
==
'
normal
'
:
# single message
event_type
=
_
(
'
New Single Message
'
)
...
...
@@ -282,7 +282,7 @@ def notify(event, jid, account, parameters, advanced_notif_num = None):
text
=
message
path
=
gtkgui_helpers
.
get_path_to_generic_or_avatar
(
img
)
popup
(
event_type
,
jid
,
account
,
message_type
,
path_to_image
=
path
,
title
=
title
,
text
=
text
)
path_to_image
=
path
,
title
=
title
,
text
=
text
)
if
do_sound
:
snd_file
=
None
...
...
@@ -316,8 +316,8 @@ def notify(event, jid, account, parameters, advanced_notif_num = None):
except
:
pass
def
popup
(
event_type
,
jid
,
account
,
msg_type
=
''
,
path_to_image
=
None
,
title
=
None
,
text
=
None
):
def
popup
(
event_type
,
jid
,
account
,
msg_type
=
''
,
path_to_image
=
None
,
title
=
None
,
text
=
None
):
'''
Notifies a user of an event. It first tries to a valid implementation of
the Desktop Notification Specification. If that fails, then we fall back to
the older style PopupNotificationWindow method.
'''
...
...
@@ -413,7 +413,7 @@ class NotificationResponseManager:
if
diff
>
10
:
self
.
received
.
remove
(
rec
)
def
on_closed
(
self
,
id
,
reason
=
None
):
def
on_closed
(
self
,
id
,
reason
=
None
):
if
self
.
pending
.
has_key
(
id
):
del
self
.
pending
[
id
]
...
...
@@ -437,8 +437,8 @@ notification_response_manager = NotificationResponseManager()
class
DesktopNotification
:
'''
A DesktopNotification that interfaces with D-Bus via the Desktop
Notification specification
'''
def
__init__
(
self
,
event_type
,
jid
,
account
,
msg_type
=
''
,
path_to_image
=
None
,
title
=
None
,
text
=
None
):
def
__init__
(
self
,
event_type
,
jid
,
account
,
msg_type
=
''
,
path_to_image
=
None
,
title
=
None
,
text
=
None
):
self
.
path_to_image
=
path_to_image
self
.
event_type
=
event_type
self
.
title
=
title
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment