]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
chop off resource in chat stuff
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 27 Dec 2006 18:42:32 +0000 (18:42 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 27 Dec 2006 18:42:32 +0000 (18:42 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3850 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_dingaling/mod_dingaling.c

index 344828e2dfb94e88b025c320a68e5c450e01fc1e..4f3637b4cfd14d449d07200bb03c89a2fce3cce8 100644 (file)
@@ -391,7 +391,7 @@ static void pres_event_handler(switch_event_t *event)
 
 static switch_status_t chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint)
 {
-       char *user, *host, *f_user = NULL, *ffrom = NULL, *f_host = NULL;
+       char *user, *host, *f_user = NULL, *ffrom = NULL, *f_host = NULL, *f_resource = NULL;
        struct mdl_profile *profile = NULL;
 
        assert(proto != NULL);
@@ -399,6 +399,9 @@ static switch_status_t chat_send(char *proto, char *from, char *to, char *subjec
        if (from && (f_user = strdup(from))) {
                if ((f_host = strchr(f_user, '@'))) {
                        *f_host++ = '\0';
+            if ((f_resource = strchr(f_host, '/'))) {
+                *f_resource++ = '\0';
+            }
                }
        }