[ekiga/gnome-2-26] Backported change from master to make sure no special chars are shown in uris.



commit e41d54b64d6b3c3b366bb479433454154a98dee6
Author: Damien Sandras <dsandras seconix com>
Date:   Thu Jul 2 09:30:40 2009 +0200

    Backported change from master to make sure no special chars are shown in uris.

 lib/engine/components/opal/opal-call.cpp |   32 ++++++++++++-----------------
 1 files changed, 13 insertions(+), 19 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index 9c6d47f..e56f3a6 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -302,9 +302,9 @@ Opal::Call::is_outgoing () const
 void
 Opal::Call::parse_info (OpalConnection & connection)
 {
-  char special_chars [] = "([;=$";
-  int i = 0;
-  std::string::size_type idx;
+  char start_special_chars [] = "$";
+  char end_special_chars [] = "([;=";
+
   std::string l_party_name;
   std::string r_party_name;
   std::string app;
@@ -315,8 +315,11 @@ Opal::Call::parse_info (OpalConnection & connection)
 
     remote_uri = (const char *) connection.GetRemotePartyCallbackURL ();
 
-    l_party_name = (const char *) connection.GetCalledPartyURL ();
-    r_party_name = (const char *) connection.GetRemotePartyName ();
+    l_party_name = (const char *) connection.GetLocalPartyName ();
+    if (connection.GetRemotePartyName () == connection.GetRemotePartyAddress ())
+      r_party_name = remote_uri;
+    else
+      r_party_name = (const char *) connection.GetRemotePartyName ();
     app = (const char *) connection.GetRemoteProductInfo ().AsString ();
     start_time = connection.GetConnectionStartTime ();
     if (!start_time.IsValid ())
@@ -329,21 +332,12 @@ Opal::Call::parse_info (OpalConnection & connection)
     if (!app.empty ())
       remote_application = app;
 
-    while (i < 3) {
+    strip_special_chars (remote_party_name, end_special_chars, false);
+    strip_special_chars (remote_application, end_special_chars, false);
+    strip_special_chars (remote_uri, end_special_chars, false);
 
-      idx = remote_party_name.find_first_of (special_chars [i]);
-      if (idx != std::string::npos)
-        remote_party_name = remote_party_name.substr (0, idx);
-
-      idx = remote_application.find_first_of (special_chars [i]);
-      if (idx != std::string::npos)
-        remote_application = remote_application.substr (0, idx);
-
-      idx = remote_uri.find_first_of (special_chars [i]);
-      if (idx != std::string::npos)
-        remote_uri = remote_uri.substr (0, idx);
-      i++;
-    }
+    strip_special_chars (remote_party_name, start_special_chars, true);
+    strip_special_chars (remote_uri, start_special_chars, true);
   }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]