Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
23fb1217
Commit
23fb1217
authored
Jun 29, 2010
by
Emmanuel Milou
Browse files
[#3620] Receive the message on the client side
parent
d5a84ba9
Changes
8
Hide whitespace changes
Inline
Side-by-side
sflphone-client-gnome/src/dbus/dbus.c
View file @
23fb1217
...
...
@@ -120,11 +120,11 @@ voice_mail_cb(DBusGProxy *proxy UNUSED, const gchar* accountID, const guint nb,
}
static
void
incoming_message_cb
(
DBusGProxy
*
proxy
UNUSED
,
const
gchar
*
account
ID
UNUSED
,
incoming_message_cb
(
DBusGProxy
*
proxy
UNUSED
,
const
gchar
*
call
ID
UNUSED
,
const
gchar
*
msg
,
void
*
foo
UNUSED
)
{
DEBUG
(
"Message %s!"
,
msg
);
DEBUG
(
"Message %s!"
,
msg
);
notify_incoming_message
(
callID
,
msg
);
}
static
void
...
...
sflphone-client-gnome/src/sflnotify.c
View file @
23fb1217
...
...
@@ -67,6 +67,24 @@ void create_new_gnome_notification (gchar *title, gchar *body, NotifyUrgency urg
}
}
void
notify_incoming_message
(
const
gchar
*
callID
,
const
gchar
*
msg
)
{
gchar
*
text
;
gchar
*
title
;
title
=
g_markup_printf_escaped
(
_
(
"New message"
));
text
=
g_markup_printf_escaped
(
_
(
"%s says: %s"
),
callID
,
msg
);
create_new_gnome_notification
(
title
,
text
,
NOTIFY_URGENCY_CRITICAL
,
(
g_strcasecmp
(
__TIMEOUT_MODE
,
"default"
)
==
0
)
?
__TIMEOUT_TIME
:
NOTIFY_EXPIRES_NEVER
,
&
_gnome_notification
);
}
void
notify_incoming_call
(
callable_obj_t
*
c
)
...
...
sflphone-client-gnome/src/sflnotify.h
View file @
23fb1217
...
...
@@ -62,6 +62,13 @@ void free_notification (GnomeNotification *g);
*/
void
notify_incoming_call
(
callable_obj_t
*
c
);
/**
* Notify an incoming text message
* A dialog box is attached to the status icon
* @param c The incoming message
*/
void
notify_incoming_message
(
const
gchar
*
callID
,
const
gchar
*
msg
);
/**
* Notify voice mails count
* An info box is attached to the status icon
...
...
sflphone-common/src/managerimpl.cpp
View file @
23fb1217
...
...
@@ -1611,11 +1611,12 @@ bool ManagerImpl::incomingCall (Call* call, const AccountID& accountId) {
return
true
;
}
//THREAD=VoIP
void
ManagerImpl
::
incomingMessage
(
const
AccountID
&
accountId
,
void
ManagerImpl
::
incomingMessage
(
const
CallID
&
callID
,
const
std
::
string
&
message
)
{
if
(
_dbus
)
{
_dbus
->
getCallManager
()
->
incomingMessage
(
accountId
,
message
);
_dbus
->
getCallManager
()
->
incomingMessage
(
callID
,
message
);
}
}
...
...
sflphone-common/src/managerimpl.h
View file @
23fb1217
...
...
@@ -398,7 +398,7 @@ class ManagerImpl {
* @param accountId The account identifier
* @param message The content of the message
*/
void
incomingMessage
(
const
AccountID
&
account
Id
,
const
std
::
string
&
message
);
void
incomingMessage
(
const
CallID
&
call
Id
,
const
std
::
string
&
message
);
/**
* Notify the client he has voice mails
...
...
sflphone-common/src/sip/im/InstantMessaging.cpp
View file @
23fb1217
...
...
@@ -13,13 +13,26 @@ namespace sfl {
return
PJ_SUCCESS
;
}
pj_status_t
InstantMessaging
::
receive
(
std
::
string
message
,
CallID
&
id
)
{
std
::
string
InstantMessaging
::
receive
(
std
::
string
message
,
CallID
&
id
)
{
// We just receive a TEXT message. Before sent it to the recipient, we must assure that the message is complete.
// We should use a queue to push these messages in
_debug
(
"New message : %s"
,
message
.
c_str
());
// TODO Archive the messages
// TODO Security check
// TODO String cleaning
return
message
;
}
pj_status_t
InstantMessaging
::
notify
(
CallID
&
id
)
{
// Notify the clients through a D-Bus signal
}
pj_status_t
InstantMessaging
::
send
(
pjsip_inv_session
*
session
,
const
std
::
string
&
text
)
{
...
...
sflphone-common/src/sip/im/InstantMessaging.h
View file @
23fb1217
...
...
@@ -43,7 +43,7 @@ namespace sfl {
* @param message The message contained in the TEXT message
* @param id The call recipient of the message
*/
pj_status_t
receive
(
std
::
string
message
,
CallID
&
id
);
std
::
string
receive
(
std
::
string
message
,
CallID
&
id
);
/*
* Send a SIP string message inside a call
...
...
sflphone-common/src/sip/sipvoiplink.cpp
View file @
23fb1217
...
...
@@ -3409,8 +3409,11 @@ void call_on_tsx_changed (pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_
pjsip_dlg_create_response
(
inv
->
dlg
,
r_data
,
PJSIP_SC_OK
,
NULL
,
&
t_data
);
pjsip_dlg_send_response
(
inv
->
dlg
,
tsx
,
t_data
);
imModule
->
receive
(
message
,
call
->
getCallId
());
// Pass through the instant messaging module if needed
// Right now, it does do anything.
// And notify the clients
Manager
::
instance
().
incomingMessage
(
call
->
getCallId
(),
imModule
->
receive
(
message
,
call
->
getCallId
()));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment