Module: sip-router
Branch: master
Commit: f375eef5e2559847bb42381fdb6a9727692004b4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f375eef…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Jun 3 10:25:19 2011 +0200
imc: fix announcing attepts to join private rooms
- if an user cannot join a private room, the announcement was wrong,
using invalid structure
- reported by Ozren Lapcevic
---
modules_k/imc/imc_cmd.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/modules_k/imc/imc_cmd.c b/modules_k/imc/imc_cmd.c
index 0bf8e50..6c1e3bc 100644
--- a/modules_k/imc/imc_cmd.c
+++ b/modules_k/imc/imc_cmd.c
@@ -326,13 +326,22 @@ int imc_handle_join(struct sip_msg* msg, imc_cmd_t *cmd,
build_inform:
/* send info message */
body.s = imc_body_buf;
- body.len = snprintf(body.s, IMC_BUF_SIZE, "*** <%.*s> has joined the
room",
- member->uri.len, member->uri.s);
+ if(member!=NULL)
+ {
+ body.len = snprintf(body.s, IMC_BUF_SIZE,
+ "*** <%.*s(a)%.*s> has joined the room",
+ src->user.len, src->user.s, src->host.len, src->host.s);
+
+ } else {
+ body.len = snprintf(body.s, IMC_BUF_SIZE,
+ "*** <%.*s(a)%.*s> attempted to join the room",
+ src->user.len, src->user.s, src->host.len, src->host.s);
+ }
if(body.len>0)
imc_room_broadcast(room, &all_hdrs, &body);
-
if(body.len>=IMC_BUF_SIZE)
- LM_ERR("member name %.*s truncated\n", member->uri.len,
member->uri.s);
+ LM_ERR("member name %.*s(a)%.*s truncated\n",
+ src->user.len, src->user.s, src->host.len, src->host.s);
done:
if(room!=NULL)