<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/103521/">http://git.reviewboard.kde.org/r/103521/</a>
     </td>
    </tr>
   </table>
   <br />









<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/103521/diff/1/?file=44656#file44656line94" style="color: black; font-weight: bold; text-decoration: underline;">x-messenger-oauth2-prompt.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">XMessengerOAuth2Prompt::XMessengerOAuth2Prompt(QWidget* parent) :</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">94</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">KUrl</span> <span class="n">url</span><span class="p">(</span><span class="n">QString</span><span class="p">(</span><span class="n">QLatin1String</span><span class="p">(</span><span class="s">"https://oauth.live.com/authorize?response_type=token&redirect_uri=%1&client_id=%2&scope=wl.messenger"</span><span class="p">)).</span><span class="n">arg</span><span class="p">(</span><span class="n">redirectUri</span><span class="p">).</span><span class="n">arg</span><span class="p">(</span><span class="n">msnClientID</span><span class="p">));</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">If this is all one constant, why do you construct it at runtime like this?</pre>
</div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/103521/diff/1/?file=44656#file44656line143" style="color: black; font-weight: bold; text-decoration: underline;">x-messenger-oauth2-prompt.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">XMessengerOAuth2Prompt::XMessengerOAuth2Prompt(QWidget* parent) :</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">143</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">QString</span> <span class="n">accessToken</span> <span class="o">=</span> <span class="n">url</span><span class="p">.</span><span class="n">encodedFragment</span><span class="p">();</span>   <span class="c1">// Get the URL fragment part</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">144</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">accessToken</span> <span class="o">=</span> <span class="n">accessToken</span><span class="p">.</span><span class="n">split</span><span class="p">(</span><span class="s">"&"</span><span class="p">).</span><span class="n">first</span><span class="p">();</span>  <span class="c1">// Remove the "expires_in" part.</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">145</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">accessToken</span> <span class="o">=</span> <span class="n">accessToken</span><span class="p">.</span><span class="n">split</span><span class="p">(</span><span class="s">"="</span><span class="p">).</span><span class="n">at</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>    <span class="c1">// Split by "access_token=..." and take latter part</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hmm, this is a bit fragile... what happens if the server starts having variables in this url in a different order?</pre>
</div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/103521/diff/1/?file=44656#file44656line151" style="color: black; font-weight: bold; text-decoration: underline;">x-messenger-oauth2-prompt.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">XMessengerOAuth2Prompt::XMessengerOAuth2Prompt(QWidget* parent) :</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">151</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="kt">char</span><span class="o">*</span> <span class="n">data</span> <span class="o">=</span> <span class="n">QByteArray</span><span class="o">::</span><span class="n">fromBase64</span><span class="p">(</span><span class="n">QByteArray</span><span class="o">::</span><span class="n">fromPercentEncoding</span><span class="p">(</span><span class="n">accessToken</span><span class="p">.</span><span class="n">toUtf8</span><span class="p">())).</span><span class="n">data</span><span class="p">();</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">BIG BIG bug here. .data() will return the internal data pointer of QByteArray, but as soon as this line is executed, QByteArray goes out of scope and data is not a valid pointer anymore.</pre>
</div>
<br />



<p>- George</p>


<br />
<p>On December 23rd, 2011, 3:25 p.m., Daniele Elmo Domenichelli wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Telepathy.</div>
<div>By Daniele Elmo Domenichelli.</div>


<p style="color: grey;"><i>Updated Dec. 23, 2011, 3:25 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Refactor SaslAuthOp to support different authentication methods, support X-MESSENGER-OAUTH2 authentication mechanism and make dialogs modeless

branch here: http://quickgit.kde.org/?p=scratch%2Fddomenichelli%2Ftelepathy-auth-handler.git&a=shortlog&h=refs/heads/oauth2

At the moment there is no support from the kcm, therefore you will have to add to your ~/.mission-control/accounts/accounts.cfg something like this:

[gabble/jabber/messenger_2elive_2ecom0]
manager=gabble
protocol=jabber
param-server=xmpp.messenger.live.com
param-account=messenger.live.com
param-ignore-ssl-errors=true
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Can login to MSN using gabble/xmpp
Can still login using old method (either with password prompt or stored password)</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=283307">283307</a>, 

 <a href="http://bugs.kde.org/show_bug.cgi?id=289668">289668</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>CMakeLists.txt <span style="color: grey">(1a263b66349074e8d409adfefd7d53af7d05a07d)</span></li>

 <li>password-prompt.h <span style="color: grey">(fc686ca4be3cc88cc7f968f6fca6f8a2c89019fe)</span></li>

 <li>password-prompt.cpp <span style="color: grey">(e23842913c33efce29ff9cc1f474c7acf0449c30)</span></li>

 <li>password-prompt.ui <span style="color: grey">(7f5009e0f473bdb3c70a600b70a7f12b8fa6827d)</span></li>

 <li>sasl-auth-op.h <span style="color: grey">(e58543b6de9b50e05f6d6c5e3ccabf6fa90bc2f3)</span></li>

 <li>sasl-auth-op.cpp <span style="color: grey">(b65baacc4afa1323fd2392f621b3944d702138c1)</span></li>

 <li>sasl-handler.cpp <span style="color: grey">(ad34e37e7f757dac1fda95c0f8e8dbece1aae9af)</span></li>

 <li>x-messenger-oauth2-auth-operation.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>x-messenger-oauth2-auth-operation.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>x-messenger-oauth2-prompt.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>x-messenger-oauth2-prompt.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>x-telepathy-password-auth-operation.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>x-telepathy-password-auth-operation.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>x-telepathy-password-prompt.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>x-telepathy-password-prompt.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>x-telepathy-password-prompt.ui <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/103521/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>