Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-daemon
Commits
af1deb13
Commit
af1deb13
authored
13 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #7501: disable libnotify functionality versions < 0.7.2
parent
f199be60
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gnome/src/sflnotify.c
+26
-0
26 additions, 0 deletions
gnome/src/sflnotify.c
with
26 additions
and
0 deletions
gnome/src/sflnotify.c
+
26
−
0
View file @
af1deb13
...
...
@@ -33,16 +33,21 @@
#include
"sflnotify.h"
#include
"logger.h"
#define USE_NOTIFY NOTIFY_CHECK_VERSION(0,7,2)
#if USE_NOTIFY
typedef
struct
{
NotifyNotification
*
notification
;
gchar
*
title
;
gchar
*
body
;
GdkPixbuf
*
icon
;
}
GnomeNotification
;
#endif
static
void
create_new_gnome_notification
(
gchar
*
title
,
gchar
*
body
,
NotifyUrgency
urgency
,
gint
timeout
)
{
#if USE_NOTIFY
GnomeNotification
notif
;
if
(
eel_gconf_get_integer
(
NOTIFY_ALL
))
{
...
...
@@ -68,22 +73,26 @@ create_new_gnome_notification(gchar *title, gchar *body, NotifyUrgency urgency,
g_free
(
title
);
g_free
(
body
);
#endif
}
void
notify_incoming_message
(
const
gchar
*
callID
,
const
gchar
*
msg
)
{
#if USE_NOTIFY
gchar
*
title
=
g_markup_printf_escaped
(
_
(
"%s says:"
),
callID
);
create_new_gnome_notification
(
title
,
(
gchar
*
)
msg
,
NOTIFY_URGENCY_CRITICAL
,
(
g_strcasecmp
(
__TIMEOUT_MODE
,
"default"
)
==
0
)
?
__TIMEOUT_TIME
:
NOTIFY_EXPIRES_NEVER
);
#endif
}
void
notify_incoming_call
(
callable_obj_t
*
c
)
{
#if USE_NOTIFY
gchar
*
title
;
if
(
strlen
(
c
->
_accountID
)
==
0
)
...
...
@@ -100,11 +109,13 @@ notify_incoming_call(callable_obj_t* c)
callerid
,
NOTIFY_URGENCY_CRITICAL
,
(
g_strcasecmp
(
__TIMEOUT_MODE
,
"default"
)
==
0
)
?
__TIMEOUT_TIME
:
NOTIFY_EXPIRES_NEVER
);
#endif
}
void
notify_voice_mails
(
guint
count
,
account_t
*
acc
)
{
#if USE_NOTIFY
// the account is different from NULL
gchar
*
title
=
g_markup_printf_escaped
(
_
(
"%s account : %s"
)
,
(
gchar
*
)
g_hash_table_lookup
(
acc
->
properties
,
ACCOUNT_TYPE
)
,
...
...
@@ -115,11 +126,13 @@ notify_voice_mails(guint count, account_t* acc)
body
,
NOTIFY_URGENCY_LOW
,
NOTIFY_EXPIRES_DEFAULT
);
#endif
}
void
notify_current_account
(
account_t
*
acc
)
{
#if USE_NOTIFY
// the account is different from NULL
gchar
*
body
=
g_markup_printf_escaped
(
_
(
"Calling with %s account <i>%s</i>"
),
(
gchar
*
)
g_hash_table_lookup
(
acc
->
properties
,
ACCOUNT_TYPE
)
,
...
...
@@ -129,70 +142,83 @@ notify_current_account(account_t* acc)
create_new_gnome_notification
(
title
,
body
,
NOTIFY_URGENCY_NORMAL
,
NOTIFY_EXPIRES_DEFAULT
);
#endif
}
void
notify_no_accounts
()
{
#if USE_NOTIFY
gchar
*
body
=
g_markup_printf_escaped
(
_
(
"You have no accounts set up"
));
gchar
*
title
=
g_markup_printf_escaped
(
_
(
"Error"
));
create_new_gnome_notification
(
title
,
body
,
NOTIFY_URGENCY_CRITICAL
,
NOTIFY_EXPIRES_DEFAULT
);
#endif
}
void
notify_no_registered_accounts
()
{
#if USE_NOTIFY
gchar
*
body
=
g_markup_printf_escaped
(
_
(
"You have no registered accounts"
));
gchar
*
title
=
g_markup_printf_escaped
(
_
(
"Error"
));
create_new_gnome_notification
(
title
,
body
,
NOTIFY_URGENCY_CRITICAL
,
NOTIFY_EXPIRES_DEFAULT
);
#endif
}
void
notify_secure_on
(
callable_obj_t
*
c
)
{
#if USE_NOTIFY
gchar
*
title
=
g_markup_printf_escaped
(
"Secure mode on."
);
gchar
*
callerid
=
g_markup_printf_escaped
(
_
(
"<i>With:</i> %s
\n
using %s"
)
,
c
->
_peer_number
,
c
->
_srtp_cipher
);
create_new_gnome_notification
(
title
,
callerid
,
NOTIFY_URGENCY_CRITICAL
,
(
g_strcasecmp
(
__TIMEOUT_MODE
,
"default"
)
==
0
)
?
__TIMEOUT_TIME
:
NOTIFY_EXPIRES_NEVER
);
#endif
}
void
notify_zrtp_not_supported
(
callable_obj_t
*
c
)
{
#if USE_NOTIFY
gchar
*
title
=
g_markup_printf_escaped
(
"ZRTP Error."
);
gchar
*
callerid
=
g_markup_printf_escaped
(
_
(
"%s does not support ZRTP."
)
,
c
->
_peer_number
);
create_new_gnome_notification
(
title
,
callerid
,
NOTIFY_URGENCY_CRITICAL
,
(
g_strcasecmp
(
__TIMEOUT_MODE
,
"default"
)
==
0
)
?
__TIMEOUT_TIME
:
NOTIFY_EXPIRES_NEVER
);
#endif
}
void
notify_zrtp_negotiation_failed
(
callable_obj_t
*
c
)
{
#if USE_NOTIFY
gchar
*
title
=
g_markup_printf_escaped
(
"ZRTP Error."
);
gchar
*
callerid
=
g_markup_printf_escaped
(
_
(
"ZRTP negotiation failed with %s"
),
c
->
_peer_number
);
create_new_gnome_notification
(
title
,
callerid
,
NOTIFY_URGENCY_CRITICAL
,
(
g_strcasecmp
(
__TIMEOUT_MODE
,
"default"
)
==
0
)
?
__TIMEOUT_TIME
:
NOTIFY_EXPIRES_NEVER
);
#endif
}
void
notify_secure_off
(
callable_obj_t
*
c
)
{
#if USE_NOTIFY
gchar
*
title
=
g_markup_printf_escaped
(
"Secure mode is off."
);
gchar
*
callerid
=
g_markup_printf_escaped
(
_
(
"<i>With:</i> %s"
),
c
->
_peer_number
);
create_new_gnome_notification
(
title
,
callerid
,
NOTIFY_URGENCY_CRITICAL
,
(
g_strcasecmp
(
__TIMEOUT_MODE
,
"default"
)
==
0
)
?
__TIMEOUT_TIME
:
NOTIFY_EXPIRES_NEVER
);
#endif
}
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