On Mon, Apr 6, 2009 at 1:01 PM, Youness Alaoui <
[email protected]> wrote:

>
>
> On Mon, Apr 6, 2009 at 2:26 AM, Ubitux <[email protected]> wrote:
>
>> 2009/4/5 Stéphane Bisinger <[email protected]>:
>> > Hi,
>> > when I log in with amsn2 I get an exception in pymsn:
>> >
>> > Traceback (most recent call last):
>> >  File "./pymsn/pymsn/msnp/base.py", line 106, in _dispatch_command
>> >    handler(command)
>> >  File "./pymsn/pymsn/msnp/notification.py", line 485, in _handle_MSG
>> >    self._client.oim_box.sync(mail_data)
>> >  File "./pymsn/pymsn/service/OfflineIM/offline_messages_box.py", line
>> > 247, in sync
>> >    self.__parse_metadata(xml_data)
>> >  File "./pymsn/pymsn/service/OfflineIM/offline_messages_box.py", line
>> > 267, in __parse_metadata
>> >    search_by_network_id(network_id)[0]
>> > UnboundLocalError: local variable 'network_id' referenced before
>> assignment
>> >
>> > Looking at the code the culprit is this:
>> >
>> >     network = (m.findtext('T','int'), m.findtext('S','int'))
>> >         if network == (11,6):
>> >            network_id = NetworkID.MSN
>> >         elif network == (13,7):
>> >            network_id = NetworkID.EXTERNAL
>> >    [code goes on doing other things]
>> >
>> > as you can see, if network has a value which is not (11,6) or (13,7)
>> > network_id is not set, so the following code fails. My XML is this
>> > (email addresses censored, indentation added by me):
>> >
>> > <MD>
>> >    <E>
>> >        <I>0</I>
>> >        <IU>0</IU>
>> >        <O>0</O>
>> >        <OU>0</OU>
>> >    </E>
>> >    <Q>
>> >        <QTM>409600</QTM>
>> >        <QNM>204800</QNM>
>> >    </Q>
>> >    <M>
>> >        <T>11</T>
>> >        <S>7</S>
>> >        <RT>2009-03-08T11:35:26.830Z</RT>
>> >        <RS>0</RS>
>> >        <SZ>1352</SZ>
>> >        <E>[email protected]</E>
>> >        <I>1147F0EF-5BBC-4B43-AE09-2B0714993B6B</I>
>> >        <F>00000000-0000-0000-0000-000000000009</F>
>> >        <N>=?utf-8?B?R2l1c3k=?=</N>
>> >    </M>
>> >    <M>
>> >        <T>11</T>
>> >        <S>7</S>
>> >        <RT>2009-03-21T19:49:31.663Z</RT>
>> >        <RS>0</RS>
>> >        <SZ>1084</SZ>
>> >        <E>[email protected]</E>
>> >        <I>EF1B4205-A0D1-4EB9-9579-4AA03A470805</I>
>> >        <F>00000000-0000-0000-0000-000000000009</F>
>> >        <N>=?utf-8?B?Z2l1c2VwcGU=?=</N>
>> >    </M>
>> > </MD>
>> >
>> > This means that the network variable is set to (11,7). Now I have no
>> > idea what this means and neither does msnpiki
>> > (
>> http://msnpiki.msnfanatic.com/index.php/MSNP13:Offline_IM#Meaning_of_the_fields
>> )
>> > and I have no idea what will change in pymsn by setting network_id to
>> > something inaccurate. For now I did a quick fix which I believe should
>> > be correct, but I'll need someone's wisdom on the MSNP (Youness? :D )
>> > to check and possibly correct it. The patch is this:
>> >
>> http://github.com/Kjir/amsn2/commit/cd959b451ff18e4f73a4a62a0d4ec5a5abb7af14
>> >
>>
> Well, I guess it's doing it wrong! It should probably just check for the
> 11/13 or the 6/7, not both of them since the network id is definitely not
> both values combined!
> It should also do an 'else'
>
>>
>> > Thanks
>> >
>> >
>> > --
>> > Stéphane
>> >
>> >
>> ------------------------------------------------------------------------------
>> > _______________________________________________
>> > Amsn-devel mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/amsn-devel
>> >
>>
>> I've fixed this in the dev branch you can find on the launchpad.
>>
> nooo, why would you fix it in launchpad? I'm trying to move pymsn to git
> now! Please have the pymsn git as the latest development branch!
> I'll try to fix it correctly and push it to the pymsn git branch.
> Thanks!
> KaKaRoTo
>
oh, I see.. Ubitux just told me that the fix is actually old... and i
checked, and it's indeed in our git (not amsn2, but collabora's).
I've been reading on git submodule, and I think we should remove pymsn from
amsn2's git repo and have it as a submodule that would point to :
http://git.collabora.co.uk/?p=user/kakaroto/pymsn.git;a=summary
git submodule info :
http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html
If anyone is interested in doing it...

> --
>> ubitux
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Amsn-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/amsn-devel
>>
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Amsn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to