From d3d28c4756b1a6a8aca2a1c03f773305fe9ee156 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 8 Nov 2015 14:47:56 +0100 Subject: [PATCH] Changed: Support new forums URLs --- code/ryzom/client/src/login.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index ee8224d08..16cf5d17a 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -1910,16 +1910,26 @@ class CAHOpenURL : public IActionHandler return; } + // modify existing languages + + // old site string::size_type pos_lang = url.find("/en/"); - if(pos_lang!=string::npos) - url.replace(pos_lang+1, 2, ClientCfg.getHtmlLanguageCode()); + // or new forums + if (pos_lang != string::npos) + pos_lang = url.find("=en#"); - if(url.find('?')!=string::npos) + if (pos_lang != string::npos) + url.replace(pos_lang + 1, 2, ClientCfg.getHtmlLanguageCode()); + + // append language + if (url.find('?') != string::npos) url += "&"; else url += "?"; + url += "language=" + ClientCfg.LanguageCode; + openURL(url.c_str()); nlinfo("openURL %s", url.c_str());