Discussion:
[ gaim-Patches-1621854 ] brings soc-2006-msnp13 up to head
SourceForge.net
2007-04-09 08:36:20 UTC
Permalink
Patches item #1621854, was opened at 2006-12-25 04:36
Message generated for change (Comment added) made by jason_syu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ka-Hing Cheung (bsponline)
Assigned to: Sean Egan (seanegan)
Summary: brings soc-2006-msnp13 up to head

Initial Comment:
This tarball brings soc-2006-msnp13 up to head. In addition to that it also fixes a crash with sending offline messages.

I wasn't able to generate a diff against that branch, svn seems to insist on diff'ing against HEAD after I run the merge command. After running `svn merge -r 16309:HEAD https://gaim.svn.sourceforge.net/svnroot/gaim/trunk` on the soc-2006-msnp13 you can replace the msn directory with the attached tarball. The fix for offline messaging is on msn.c:901:

if (!session->oim)
session->oim = msn_oim_new(session)



----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 08:36

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-04-01 21:03

Message:
Logged In: YES
user_id=1525231
Originator: NO

Couple patches again:
http://koti.mbnet.fi/simom/gaim-msnp13/markup_escape_psm.diff
PSM needs to be escaped, tooltip rendering fails if PSM had '&' in it.

http://koti.mbnet.fi/simom/gaim-msnp13/currentmedia.diff
Support for showing current media of buddies in buddy list. Tooltip shows
both PSM and current media if they are both set, but status line shows only
current media if it is set (official client behaviour). Note: This patch
already includes escaping of PSM, you don't need markup_escape_psm.diff if
you use this.
I know there are bigger problems at the moment than lack of current media
support, but here it is anyway :)

----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-16 09:18

Message:
Logged In: YES
user_id=1525231
Originator: NO

Two little patches, first one prevents own account to be added as a buddy
to buddylist, and second fixes tooltip messing with status and PSM.

http://koti.mbnet.fi/simom/gaim-msnp13/own-account-as-buddy.diff
http://koti.mbnet.fi/simom/gaim-msnp13/psm-in-tooltip.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-16 06:35

Message:
Logged In: YES
user_id=159910
Originator: YES

A little late, but here is a version that should remember your friendly
name. Also has a fix for a crasher when MSN sends you back:

<faultstring>Need to do full sync. Can't sync deltas Client
has too old a copy for us to do a delta sync</faultstring>

In this case, I make gaim re-request the full contact list/address book.

I haven't look too deeply into the reverse list problem, but I think the
solution would involve caching the reverse list, which may require
extending the privacy api.
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-16 03:30

Message:
Logged In: YES
user_id=159910
Originator: YES

Updated the diff with basically no change, except with simom's icon fix.
The previous diff was broken because some of the files were not added

Had to compress it because of sourceforge file size limit
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-10 20:39

Message:
Logged In: YES
user_id=159910
Originator: YES

uploaded a diff, this diff is unchanged from the last tarball that I
previously uploaded, except that it's against HEAD. This should be a little
easier for most people.

File Added: msn-p13-merge-head.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-07 07:54

Message:
Logged In: YES
user_id=159910
Originator: YES

Another way is to make a SOAP request whenever the friendly name is set,
and set the friendly name every time you sign on, which doesn't fix the
reverse list problem, but does allow the friendly name to persist. I
already have the first part written.

I apologize if my lack of activity wasted you too much time.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-06 11:22

Message:
Logged In: YES
user_id=1525231
Originator: NO

One way too is to ask full contact list and address book every time
(*Changes=NULL in certain function calls), I tried this too, it works but
logging in takes some more time. It actually fixes reverse list -problem
too, but maybe local caching would still be a better solution as it is
planned to work that way and it reduces bandwidth-usage.

----------------------------------------------------------------------

Comment By: Mark Doliner (thekingant)
Date: 2007-03-06 07:09

Message:
Logged In: YES
user_id=20979
Originator: NO

Ooh, that's so rockin'

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-06 07:02

Message:
Logged In: YES
user_id=159910
Originator: YES

I found a way to make the server resend the friendly name every time you
sign on, but I haven't had the time and motivation to finish that.
Hopefully I will find the time to look at your diff this weekend.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-05 16:43

Message:
Logged In: YES
user_id=1525231
Originator: NO

I fixed the icons by adding "b->proto_data = user;" to msn_userlist_load()
in userlist.c (see end of the patch), and Friendly name -issue by caching
it to buddylist and using that if it isn't sent by server. This seems to be
necessary as server sends only changes in information since last time.
Maybe same should be done to reverse list, as now for every buddy in my
list i get 'has you: no' in the tooltip. I also prevented own account to be
added to buddy list. Patch against msn.tgz v2 (the one dated 2006-12-30
09:17) can be found in
http://koti.mbnet.fi/simom/gaim-msnp13/msnp13-friendly-name-and-icons.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 18:54

Message:
Logged In: YES
user_id=159910
Originator: YES

I am heading out, but g_return_if_fail(cmd->param_count >= 3) means if the
condition cmd->param_count >= 3 fails, the function would return right
there. So that part is working as expected. I have no idea why sometimes I
get the friendly name and sometimes I don't.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 11:11

Message:
Logged In: YES
user_id=1678429
Originator: NO

The first two connection I receive after last USR TWN command
USR <tid> OK <email> 1 0
USR <tid2> <email> <a number of three blocks
nnnnnnnnnn.nnnnnnnn.nnnnnnnn>
USR <tid2> OK <email> <displayname>

The third time the last USR OK command is:
USR <tid2> OK <email> <email>

I changed nothing in account's setting, I only connected and disconnected
for three time. VERY strange.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 11:02

Message:
Logged In: YES
user_id=1678429
Originator: NO

Uhm... I'm trying your updated version... with a new profile.... The first
connection, it's all ok... it loads for my contact the right friendly name
from server I think because the local alias is different. I disconnected,
then reconnected, it's ok also this time; again I disconnect and then
reconnect, but at this third time... it doesn't load the friendly name, and
all my msn buddies have the same msn icon
Loading Image.... :|

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 10:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

And also I see now in prp_cmd method of notification.c your mod...
###############
static void
prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
{
MsnSession *session = cmdproc->session;
const char *type, *value;

g_return_if_fail(cmd->param_count >= 3);

type = cmd->params[2];

if (cmd->param_count == 4)
{
value = cmd->params[3];
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, gaim_url_decode(value));
}
else
{
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, NULL);
else if (!strcmp(type, "MFM")) {
type = cmd->params[1];
gaim_connection_set_display_name(
gaim_account_get_connection(session->account),
gaim_url_decode(cmd->params[2]));
}
}
}
###############################
as third instruction of the void there is
g_return_if_fail(cmd->param_count >= 3);, from whati I understand of this
void, it stop the void procedure if cmd->param_count >= 3.... but after I
see if (cmd->param_count == 4) .... so if it's right the interpretation of
g_return_if_fail the condition that follow never happen! And I also thought
that was incoerent... and so I changed the integer of values.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 10:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

I added the if (!strcmp(type, "MFN")) { in sync.c and notification.c
because it figured out in that files the void prp_cmd... and I thought that
was necessary add the parsing of that instruction... that set the nickname.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 07:17

Message:
Logged In: YES
user_id=159910
Originator: YES

new version, fixes some crashes because group_id is char * but in some
places it's set to an int (!). skadotnet, I don't understand why you need
`if (!strcmp(type, "MFN")) {` in so many places, so I didn't include most
of them. I also have different versions of some of your fixes because I
already fixed them.

Group manipulations may still not work, at least it's not crashing :-)

File Added: msn.tgz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 07:03

Message:
Logged In: YES
user_id=159910
Originator: YES

are you sure that setting the friendly name in msn_notification_post_adl()
is correct?

something is weird, sometimes I get back my own contact information in
contact.c:msn_parse_addressbook(), so I can set the display name there, and
sometimes I don't. It may have something to do with contact list caching.

I will upload a new version soon that fixes lots of compiler warning and
some crashes for group manipulations.


----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 02:38

Message:
Logged In: YES
user_id=159910
Originator: YES

I finally figured out why I couldn't sign on, I was missing a */ so a
large block of code was commented out!

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 15:35

Message:
Logged In: YES
user_id=1678429
Originator: NO

I link directly the patch file....
http://skadotnet.altervista.org/msn.patch

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 15:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

This is the patch file for the first 2 fix, it's not complete because it
need the implementation of the field where save the friendly name, now it
use local alias as first display name. It persists the problem of buddy
icon, I'm sorry but more than this I can't do.
Here the patch:
############################################################################################################################################
diff -uN msn.original/msn.c msn/msn.c
--- msn.original/msn.c 2006-12-25 03:29:57.000000000 +0100
+++ msn/msn.c 2006-12-29 16:11:15.000000000 +0100
@@ -137,9 +137,10 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ if (strlen(alias) > 0)
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
+ else
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s",
gaim_url_encode(gaim_account_get_username(account)));
}

static void
@@ -798,6 +799,9 @@

if (!msn_session_connect(session, host, port, http_method))
gaim_connection_error(gc, _("Failed to connect to server."));
+
+ // Transitional pointment to local alias. Should be the friendly name
saved at every change.
+ gaim_connection_set_display_name(gc, gaim_account_get_alias(account));
}

static void
diff -uN msn.original/notification.c msn/notification.c
--- msn.original/notification.c 2006-12-25 00:52:23.000000000 +0100
+++ msn/notification.c 2006-12-29 16:11:15.000000000 +0100
@@ -235,8 +235,9 @@
/* authenticate OK */
const char *friendly = gaim_url_decode(cmd->params[3]);

- gaim_connection_set_display_name(gc, friendly);
-
+ if (g_ascii_strcasecmp(friendly, "1"))
+ gaim_connection_set_display_name(gc, friendly);
+
msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);

// msn_cmdproc_send(cmdproc, "SYN", "%s", "0");
@@ -626,6 +627,29 @@
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;
+
+ GaimAccount *account;
+ account = cmdproc->session->account;
+
+ /*
+ * TODO: save somewhere the friendly name in accounts file, when a new
account is created,
+ * or it's set empty or equal to local alias. When a command PRP
MFN is sent through
+ * prp_cmd method in notification.c and sync.c the field in xml
config file is updated.
+ * This is loaded after login with
gaim_connection_set_display_name(GaimConnection *gc, const char *value)
[msn.c:803-804]
+ * so if we connect throught MSNP8 on USR OK command we overwrite
that field,
+ * if the length isn't equal to "1", else if we connect throught
MSNP11 or higher, on USR OK command
+ * we don't overwrite that field because the params is equals to
"1", and throught the command down here
+ * we set for the first time the saved friendly nickname.
+ */
+ const char *friendly;
+ friendly =
gaim_url_encode(gaim_connection_get_display_name(account->gc));
+
+ if (strlen(friendly) <= 0)
+ friendly = gaim_url_encode(gaim_account_get_username(account));
+
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", friendly);
+
+ gaim_debug_info("Ska","Set friendly name as
%s\n",gaim_url_decode(friendly));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
@@ -1025,12 +1049,16 @@

g_return_if_fail(cmd->param_count >= 3);

- type = cmd->params[2];
+ type = cmd->params[1];

- if (cmd->param_count == 4)
+ if (cmd->param_count == 3)
{
- value = cmd->params[3];
- if (!strcmp(type, "PHH"))
+ value = cmd->params[2];
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -1039,7 +1067,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
diff -uN msn.original/sync.c msn/sync.c
--- msn.original/sync.c 2006-12-25 00:17:41.000000000 +0100
+++ msn/sync.c 2006-12-29 16:11:15.000000000 +0100
@@ -64,7 +64,11 @@

if (cmd->param_count == 2)
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -73,7 +77,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
############################################################################################################################################

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 14:05

Message:
Logged In: YES
user_id=1678429
Originator: NO

I'm modifying the fix for second issue, that also set the display name's
field when you open the dialog for set alias manually

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 11:15

Message:
Logged In: YES
user_id=1678429
Originator: NO

There is also another bug.... all my msn buddies have the same msn icon:
this http://xs210.xs.to/xs210/06525/screenshot1.png

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 11:09

Message:
Logged In: YES
user_id=1678429
Originator: NO

I don't see any other way to solve this... when login server send the
command USR Ok, now there isn't the display name that should be stored on
the server....
I've found, I think, the right location to add this command. File
notification.c at line 625.

From:
#####################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
######################################

To:
######################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

GaimAccount *account;
account = cmdproc->session->account;

msn_cmdproc_send(cmdproc,"PRP","MFN %s",
gaim_url_encode(gaim_account_get_alias(account)));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
################################################


with this fix, now the friendly name is set at startup as the local alias
field's value.
For the old MSNP8 is still enabled the parsing of USR OK answer to look
for the display name... but connecting with MSNP13/14 it finds only the
value "1", because server answer with "USR <transid> OK <email-address> 1
0\r\n". The old parser get the fourth parameter... that now is "1", and set
it as friendly name... but then arrives another USR OK answer that
containst at fourth parameter again the email address, and again it set the
friendly name with the email address.
Using this fix, before the second USR OK answer it set the friendly name
so the second USR OK answer arrives as the old format "USR <transid> OK
<email-address> <friendly-name> 0\r\n".

There are other things to do, because, now it set the local alias, and
when you want manually change the friendly name through the dialog, the
value of textbox is "1", I don't know why.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 23:02

Message:
Logged In: YES
user_id=159910
Originator: YES

ya, I thought about that, but then with MSNP8 you can use your friendly
name that you set from elsewhere, with this it means you can't

anyway, I still need to fix the logon issue before I can do any meaningful
work again.


----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 22:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

For the second "bug", from what I could see from the code, and from
msnpiki, it's a change of commands of the protocol. Before the friendly
name ad login was recieved form USR command, but now as says
http://msnpiki.msnfanatic.com/index.php/MSNP13:Example_Session#Updating_Display_Name
after ADL command we need to send a fisrt PRP command to set the friendly
name, so we need to save somewhere the nickname.
A solution could be use the config file to save this parameter, when the
account is created this field is sat as alias field; then ad after sending
ADL command to get the contact list, send the first PRP MFN, to set first
the nickname with param the value of friendlyname field; and also add a
command to save the friendly nickname's value in the setting file, when is
modified manually throught the dialog.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 19:21

Message:
Logged In: YES
user_id=159910
Originator: YES

actually I _thought_ I fixed the 2nd issue, turns out now I can't log in
anymore :-/ reverting to old gaim code works though, will figure it out
later tonight.

feel free to take a shot

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 18:46

Message:
Logged In: YES
user_id=159910
Originator: YES

I actually have those 2 fixed already, nice job though.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 17:34

Message:
Logged In: YES
user_id=1678429
Originator: NO

I've tried the patch winth gaim svn... it works but there are some
problems with the friendly nickname... when I try to set the nickname, it
disconnect from msn. I've corrected this problem using the new msn command
to set nickname, instead of the obsolate one.

###################################################################
--- msn.c.original 2006-12-28 18:30:12.000000000 +0100
+++ msn.c 2006-12-28 18:30:34.000000000 +0100
@@ -137,9 +137,7 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
}

static void
#########################################################################

Now I'm going to solve the missed nickname's update on connect.



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
SourceForge.net
2007-04-09 08:37:55 UTC
Permalink
Patches item #1621854, was opened at 2006-12-25 04:36
Message generated for change (Comment added) made by jason_syu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ka-Hing Cheung (bsponline)
Assigned to: Sean Egan (seanegan)
Summary: brings soc-2006-msnp13 up to head

Initial Comment:
This tarball brings soc-2006-msnp13 up to head. In addition to that it also fixes a crash with sending offline messages.

I wasn't able to generate a diff against that branch, svn seems to insist on diff'ing against HEAD after I run the merge command. After running `svn merge -r 16309:HEAD https://gaim.svn.sourceforge.net/svnroot/gaim/trunk` on the soc-2006-msnp13 you can replace the msn directory with the attached tarball. The fix for offline messaging is on msn.c:901:

if (!session->oim)
session->oim = msn_oim_new(session)



----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 08:37

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 08:36

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-04-01 21:03

Message:
Logged In: YES
user_id=1525231
Originator: NO

Couple patches again:
http://koti.mbnet.fi/simom/gaim-msnp13/markup_escape_psm.diff
PSM needs to be escaped, tooltip rendering fails if PSM had '&' in it.

http://koti.mbnet.fi/simom/gaim-msnp13/currentmedia.diff
Support for showing current media of buddies in buddy list. Tooltip shows
both PSM and current media if they are both set, but status line shows only
current media if it is set (official client behaviour). Note: This patch
already includes escaping of PSM, you don't need markup_escape_psm.diff if
you use this.
I know there are bigger problems at the moment than lack of current media
support, but here it is anyway :)

----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-16 09:18

Message:
Logged In: YES
user_id=1525231
Originator: NO

Two little patches, first one prevents own account to be added as a buddy
to buddylist, and second fixes tooltip messing with status and PSM.

http://koti.mbnet.fi/simom/gaim-msnp13/own-account-as-buddy.diff
http://koti.mbnet.fi/simom/gaim-msnp13/psm-in-tooltip.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-16 06:35

Message:
Logged In: YES
user_id=159910
Originator: YES

A little late, but here is a version that should remember your friendly
name. Also has a fix for a crasher when MSN sends you back:

<faultstring>Need to do full sync. Can't sync deltas Client
has too old a copy for us to do a delta sync</faultstring>

In this case, I make gaim re-request the full contact list/address book.

I haven't look too deeply into the reverse list problem, but I think the
solution would involve caching the reverse list, which may require
extending the privacy api.
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-16 03:30

Message:
Logged In: YES
user_id=159910
Originator: YES

Updated the diff with basically no change, except with simom's icon fix.
The previous diff was broken because some of the files were not added

Had to compress it because of sourceforge file size limit
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-10 20:39

Message:
Logged In: YES
user_id=159910
Originator: YES

uploaded a diff, this diff is unchanged from the last tarball that I
previously uploaded, except that it's against HEAD. This should be a little
easier for most people.

File Added: msn-p13-merge-head.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-07 07:54

Message:
Logged In: YES
user_id=159910
Originator: YES

Another way is to make a SOAP request whenever the friendly name is set,
and set the friendly name every time you sign on, which doesn't fix the
reverse list problem, but does allow the friendly name to persist. I
already have the first part written.

I apologize if my lack of activity wasted you too much time.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-06 11:22

Message:
Logged In: YES
user_id=1525231
Originator: NO

One way too is to ask full contact list and address book every time
(*Changes=NULL in certain function calls), I tried this too, it works but
logging in takes some more time. It actually fixes reverse list -problem
too, but maybe local caching would still be a better solution as it is
planned to work that way and it reduces bandwidth-usage.

----------------------------------------------------------------------

Comment By: Mark Doliner (thekingant)
Date: 2007-03-06 07:09

Message:
Logged In: YES
user_id=20979
Originator: NO

Ooh, that's so rockin'

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-06 07:02

Message:
Logged In: YES
user_id=159910
Originator: YES

I found a way to make the server resend the friendly name every time you
sign on, but I haven't had the time and motivation to finish that.
Hopefully I will find the time to look at your diff this weekend.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-05 16:43

Message:
Logged In: YES
user_id=1525231
Originator: NO

I fixed the icons by adding "b->proto_data = user;" to msn_userlist_load()
in userlist.c (see end of the patch), and Friendly name -issue by caching
it to buddylist and using that if it isn't sent by server. This seems to be
necessary as server sends only changes in information since last time.
Maybe same should be done to reverse list, as now for every buddy in my
list i get 'has you: no' in the tooltip. I also prevented own account to be
added to buddy list. Patch against msn.tgz v2 (the one dated 2006-12-30
09:17) can be found in
http://koti.mbnet.fi/simom/gaim-msnp13/msnp13-friendly-name-and-icons.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 18:54

Message:
Logged In: YES
user_id=159910
Originator: YES

I am heading out, but g_return_if_fail(cmd->param_count >= 3) means if the
condition cmd->param_count >= 3 fails, the function would return right
there. So that part is working as expected. I have no idea why sometimes I
get the friendly name and sometimes I don't.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 11:11

Message:
Logged In: YES
user_id=1678429
Originator: NO

The first two connection I receive after last USR TWN command
USR <tid> OK <email> 1 0
USR <tid2> <email> <a number of three blocks
nnnnnnnnnn.nnnnnnnn.nnnnnnnn>
USR <tid2> OK <email> <displayname>

The third time the last USR OK command is:
USR <tid2> OK <email> <email>

I changed nothing in account's setting, I only connected and disconnected
for three time. VERY strange.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 11:02

Message:
Logged In: YES
user_id=1678429
Originator: NO

Uhm... I'm trying your updated version... with a new profile.... The first
connection, it's all ok... it loads for my contact the right friendly name
from server I think because the local alias is different. I disconnected,
then reconnected, it's ok also this time; again I disconnect and then
reconnect, but at this third time... it doesn't load the friendly name, and
all my msn buddies have the same msn icon
http://xs210.xs.to/xs210/06525/screenshot1.png. :|

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 10:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

And also I see now in prp_cmd method of notification.c your mod...
###############
static void
prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
{
MsnSession *session = cmdproc->session;
const char *type, *value;

g_return_if_fail(cmd->param_count >= 3);

type = cmd->params[2];

if (cmd->param_count == 4)
{
value = cmd->params[3];
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, gaim_url_decode(value));
}
else
{
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, NULL);
else if (!strcmp(type, "MFM")) {
type = cmd->params[1];
gaim_connection_set_display_name(
gaim_account_get_connection(session->account),
gaim_url_decode(cmd->params[2]));
}
}
}
###############################
as third instruction of the void there is
g_return_if_fail(cmd->param_count >= 3);, from whati I understand of this
void, it stop the void procedure if cmd->param_count >= 3.... but after I
see if (cmd->param_count == 4) .... so if it's right the interpretation of
g_return_if_fail the condition that follow never happen! And I also thought
that was incoerent... and so I changed the integer of values.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 10:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

I added the if (!strcmp(type, "MFN")) { in sync.c and notification.c
because it figured out in that files the void prp_cmd... and I thought that
was necessary add the parsing of that instruction... that set the nickname.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 07:17

Message:
Logged In: YES
user_id=159910
Originator: YES

new version, fixes some crashes because group_id is char * but in some
places it's set to an int (!). skadotnet, I don't understand why you need
`if (!strcmp(type, "MFN")) {` in so many places, so I didn't include most
of them. I also have different versions of some of your fixes because I
already fixed them.

Group manipulations may still not work, at least it's not crashing :-)

File Added: msn.tgz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 07:03

Message:
Logged In: YES
user_id=159910
Originator: YES

are you sure that setting the friendly name in msn_notification_post_adl()
is correct?

something is weird, sometimes I get back my own contact information in
contact.c:msn_parse_addressbook(), so I can set the display name there, and
sometimes I don't. It may have something to do with contact list caching.

I will upload a new version soon that fixes lots of compiler warning and
some crashes for group manipulations.


----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 02:38

Message:
Logged In: YES
user_id=159910
Originator: YES

I finally figured out why I couldn't sign on, I was missing a */ so a
large block of code was commented out!

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 15:35

Message:
Logged In: YES
user_id=1678429
Originator: NO

I link directly the patch file....
http://skadotnet.altervista.org/msn.patch

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 15:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

This is the patch file for the first 2 fix, it's not complete because it
need the implementation of the field where save the friendly name, now it
use local alias as first display name. It persists the problem of buddy
icon, I'm sorry but more than this I can't do.
Here the patch:
############################################################################################################################################
diff -uN msn.original/msn.c msn/msn.c
--- msn.original/msn.c 2006-12-25 03:29:57.000000000 +0100
+++ msn/msn.c 2006-12-29 16:11:15.000000000 +0100
@@ -137,9 +137,10 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ if (strlen(alias) > 0)
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
+ else
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s",
gaim_url_encode(gaim_account_get_username(account)));
}

static void
@@ -798,6 +799,9 @@

if (!msn_session_connect(session, host, port, http_method))
gaim_connection_error(gc, _("Failed to connect to server."));
+
+ // Transitional pointment to local alias. Should be the friendly name
saved at every change.
+ gaim_connection_set_display_name(gc, gaim_account_get_alias(account));
}

static void
diff -uN msn.original/notification.c msn/notification.c
--- msn.original/notification.c 2006-12-25 00:52:23.000000000 +0100
+++ msn/notification.c 2006-12-29 16:11:15.000000000 +0100
@@ -235,8 +235,9 @@
/* authenticate OK */
const char *friendly = gaim_url_decode(cmd->params[3]);

- gaim_connection_set_display_name(gc, friendly);
-
+ if (g_ascii_strcasecmp(friendly, "1"))
+ gaim_connection_set_display_name(gc, friendly);
+
msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);

// msn_cmdproc_send(cmdproc, "SYN", "%s", "0");
@@ -626,6 +627,29 @@
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;
+
+ GaimAccount *account;
+ account = cmdproc->session->account;
+
+ /*
+ * TODO: save somewhere the friendly name in accounts file, when a new
account is created,
+ * or it's set empty or equal to local alias. When a command PRP
MFN is sent through
+ * prp_cmd method in notification.c and sync.c the field in xml
config file is updated.
+ * This is loaded after login with
gaim_connection_set_display_name(GaimConnection *gc, const char *value)
[msn.c:803-804]
+ * so if we connect throught MSNP8 on USR OK command we overwrite
that field,
+ * if the length isn't equal to "1", else if we connect throught
MSNP11 or higher, on USR OK command
+ * we don't overwrite that field because the params is equals to
"1", and throught the command down here
+ * we set for the first time the saved friendly nickname.
+ */
+ const char *friendly;
+ friendly =
gaim_url_encode(gaim_connection_get_display_name(account->gc));
+
+ if (strlen(friendly) <= 0)
+ friendly = gaim_url_encode(gaim_account_get_username(account));
+
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", friendly);
+
+ gaim_debug_info("Ska","Set friendly name as
%s\n",gaim_url_decode(friendly));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
@@ -1025,12 +1049,16 @@

g_return_if_fail(cmd->param_count >= 3);

- type = cmd->params[2];
+ type = cmd->params[1];

- if (cmd->param_count == 4)
+ if (cmd->param_count == 3)
{
- value = cmd->params[3];
- if (!strcmp(type, "PHH"))
+ value = cmd->params[2];
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -1039,7 +1067,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
diff -uN msn.original/sync.c msn/sync.c
--- msn.original/sync.c 2006-12-25 00:17:41.000000000 +0100
+++ msn/sync.c 2006-12-29 16:11:15.000000000 +0100
@@ -64,7 +64,11 @@

if (cmd->param_count == 2)
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -73,7 +77,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
############################################################################################################################################

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 14:05

Message:
Logged In: YES
user_id=1678429
Originator: NO

I'm modifying the fix for second issue, that also set the display name's
field when you open the dialog for set alias manually

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 11:15

Message:
Logged In: YES
user_id=1678429
Originator: NO

There is also another bug.... all my msn buddies have the same msn icon:
this http://xs210.xs.to/xs210/06525/screenshot1.png

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 11:09

Message:
Logged In: YES
user_id=1678429
Originator: NO

I don't see any other way to solve this... when login server send the
command USR Ok, now there isn't the display name that should be stored on
the server....
I've found, I think, the right location to add this command. File
notification.c at line 625.

From:
#####################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
######################################

To:
######################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

GaimAccount *account;
account = cmdproc->session->account;

msn_cmdproc_send(cmdproc,"PRP","MFN %s",
gaim_url_encode(gaim_account_get_alias(account)));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
################################################


with this fix, now the friendly name is set at startup as the local alias
field's value.
For the old MSNP8 is still enabled the parsing of USR OK answer to look
for the display name... but connecting with MSNP13/14 it finds only the
value "1", because server answer with "USR <transid> OK <email-address> 1
0\r\n". The old parser get the fourth parameter... that now is "1", and set
it as friendly name... but then arrives another USR OK answer that
containst at fourth parameter again the email address, and again it set the
friendly name with the email address.
Using this fix, before the second USR OK answer it set the friendly name
so the second USR OK answer arrives as the old format "USR <transid> OK
<email-address> <friendly-name> 0\r\n".

There are other things to do, because, now it set the local alias, and
when you want manually change the friendly name through the dialog, the
value of textbox is "1", I don't know why.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 23:02

Message:
Logged In: YES
user_id=159910
Originator: YES

ya, I thought about that, but then with MSNP8 you can use your friendly
name that you set from elsewhere, with this it means you can't

anyway, I still need to fix the logon issue before I can do any meaningful
work again.


----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 22:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

For the second "bug", from what I could see from the code, and from
msnpiki, it's a change of commands of the protocol. Before the friendly
name ad login was recieved form USR command, but now as says
http://msnpiki.msnfanatic.com/index.php/MSNP13:Example_Session#Updating_Display_Name
after ADL command we need to send a fisrt PRP command to set the friendly
name, so we need to save somewhere the nickname.
A solution could be use the config file to save this parameter, when the
account is created this field is sat as alias field; then ad after sending
ADL command to get the contact list, send the first PRP MFN, to set first
the nickname with param the value of friendlyname field; and also add a
command to save the friendly nickname's value in the setting file, when is
modified manually throught the dialog.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 19:21

Message:
Logged In: YES
user_id=159910
Originator: YES

actually I _thought_ I fixed the 2nd issue, turns out now I can't log in
anymore :-/ reverting to old gaim code works though, will figure it out
later tonight.

feel free to take a shot

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 18:46

Message:
Logged In: YES
user_id=159910
Originator: YES

I actually have those 2 fixed already, nice job though.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 17:34

Message:
Logged In: YES
user_id=1678429
Originator: NO

I've tried the patch winth gaim svn... it works but there are some
problems with the friendly nickname... when I try to set the nickname, it
disconnect from msn. I've corrected this problem using the new msn command
to set nickname, instead of the obsolate one.

###################################################################
--- msn.c.original 2006-12-28 18:30:12.000000000 +0100
+++ msn.c 2006-12-28 18:30:34.000000000 +0100
@@ -137,9 +137,7 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
}

static void
#########################################################################

Now I'm going to solve the missed nickname's update on connect.



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
SourceForge.net
2007-04-09 23:02:22 UTC
Permalink
Patches item #1621854, was opened at 2006-12-24 22:36
Message generated for change (Comment added) made by rlaager
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ka-Hing Cheung (bsponline)
Assigned to: Sean Egan (seanegan)
Summary: brings soc-2006-msnp13 up to head

Initial Comment:
This tarball brings soc-2006-msnp13 up to head. In addition to that it also fixes a crash with sending offline messages.

I wasn't able to generate a diff against that branch, svn seems to insist on diff'ing against HEAD after I run the merge command. After running `svn merge -r 16309:HEAD https://gaim.svn.sourceforge.net/svnroot/gaim/trunk` on the soc-2006-msnp13 you can replace the msn directory with the attached tarball. The fix for offline messaging is on msn.c:901:

if (!session->oim)
session->oim = msn_oim_new(session)



----------------------------------------------------------------------
Comment By: Richard Laager (rlaager)
Date: 2007-04-09 18:02

Message:
Logged In: YES
user_id=156487
Originator: NO

I'm commenting here for the record. khc: Have you talked to Sean yet about
any MSNP?? branch he may have? I'd love to see this in a Monotone branch
now that we're public with that.

----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 03:37

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 03:36

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-04-01 16:03

Message:
Logged In: YES
user_id=1525231
Originator: NO

Couple patches again:
http://koti.mbnet.fi/simom/gaim-msnp13/markup_escape_psm.diff
PSM needs to be escaped, tooltip rendering fails if PSM had '&' in it.

http://koti.mbnet.fi/simom/gaim-msnp13/currentmedia.diff
Support for showing current media of buddies in buddy list. Tooltip shows
both PSM and current media if they are both set, but status line shows only
current media if it is set (official client behaviour). Note: This patch
already includes escaping of PSM, you don't need markup_escape_psm.diff if
you use this.
I know there are bigger problems at the moment than lack of current media
support, but here it is anyway :)

----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-16 04:18

Message:
Logged In: YES
user_id=1525231
Originator: NO

Two little patches, first one prevents own account to be added as a buddy
to buddylist, and second fixes tooltip messing with status and PSM.

http://koti.mbnet.fi/simom/gaim-msnp13/own-account-as-buddy.diff
http://koti.mbnet.fi/simom/gaim-msnp13/psm-in-tooltip.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-16 01:35

Message:
Logged In: YES
user_id=159910
Originator: YES

A little late, but here is a version that should remember your friendly
name. Also has a fix for a crasher when MSN sends you back:

<faultstring>Need to do full sync. Can't sync deltas Client
has too old a copy for us to do a delta sync</faultstring>

In this case, I make gaim re-request the full contact list/address book.

I haven't look too deeply into the reverse list problem, but I think the
solution would involve caching the reverse list, which may require
extending the privacy api.
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-15 22:30

Message:
Logged In: YES
user_id=159910
Originator: YES

Updated the diff with basically no change, except with simom's icon fix.
The previous diff was broken because some of the files were not added

Had to compress it because of sourceforge file size limit
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-10 14:39

Message:
Logged In: YES
user_id=159910
Originator: YES

uploaded a diff, this diff is unchanged from the last tarball that I
previously uploaded, except that it's against HEAD. This should be a little
easier for most people.

File Added: msn-p13-merge-head.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-07 01:54

Message:
Logged In: YES
user_id=159910
Originator: YES

Another way is to make a SOAP request whenever the friendly name is set,
and set the friendly name every time you sign on, which doesn't fix the
reverse list problem, but does allow the friendly name to persist. I
already have the first part written.

I apologize if my lack of activity wasted you too much time.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-06 05:22

Message:
Logged In: YES
user_id=1525231
Originator: NO

One way too is to ask full contact list and address book every time
(*Changes=NULL in certain function calls), I tried this too, it works but
logging in takes some more time. It actually fixes reverse list -problem
too, but maybe local caching would still be a better solution as it is
planned to work that way and it reduces bandwidth-usage.

----------------------------------------------------------------------

Comment By: Mark Doliner (thekingant)
Date: 2007-03-06 01:09

Message:
Logged In: YES
user_id=20979
Originator: NO

Ooh, that's so rockin'

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-06 01:02

Message:
Logged In: YES
user_id=159910
Originator: YES

I found a way to make the server resend the friendly name every time you
sign on, but I haven't had the time and motivation to finish that.
Hopefully I will find the time to look at your diff this weekend.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-05 10:43

Message:
Logged In: YES
user_id=1525231
Originator: NO

I fixed the icons by adding "b->proto_data = user;" to msn_userlist_load()
in userlist.c (see end of the patch), and Friendly name -issue by caching
it to buddylist and using that if it isn't sent by server. This seems to be
necessary as server sends only changes in information since last time.
Maybe same should be done to reverse list, as now for every buddy in my
list i get 'has you: no' in the tooltip. I also prevented own account to be
added to buddy list. Patch against msn.tgz v2 (the one dated 2006-12-30
09:17) can be found in
http://koti.mbnet.fi/simom/gaim-msnp13/msnp13-friendly-name-and-icons.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 12:54

Message:
Logged In: YES
user_id=159910
Originator: YES

I am heading out, but g_return_if_fail(cmd->param_count >= 3) means if the
condition cmd->param_count >= 3 fails, the function would return right
there. So that part is working as expected. I have no idea why sometimes I
get the friendly name and sometimes I don't.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 05:11

Message:
Logged In: YES
user_id=1678429
Originator: NO

The first two connection I receive after last USR TWN command
USR <tid> OK <email> 1 0
USR <tid2> <email> <a number of three blocks
nnnnnnnnnn.nnnnnnnn.nnnnnnnn>
USR <tid2> OK <email> <displayname>

The third time the last USR OK command is:
USR <tid2> OK <email> <email>

I changed nothing in account's setting, I only connected and disconnected
for three time. VERY strange.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 05:02

Message:
Logged In: YES
user_id=1678429
Originator: NO

Uhm... I'm trying your updated version... with a new profile.... The first
connection, it's all ok... it loads for my contact the right friendly name
from server I think because the local alias is different. I disconnected,
then reconnected, it's ok also this time; again I disconnect and then
reconnect, but at this third time... it doesn't load the friendly name, and
all my msn buddies have the same msn icon
http://xs210.xs.to/xs210/06525/screenshot1.png. :|

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 04:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

And also I see now in prp_cmd method of notification.c your mod...
###############
static void
prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
{
MsnSession *session = cmdproc->session;
const char *type, *value;

g_return_if_fail(cmd->param_count >= 3);

type = cmd->params[2];

if (cmd->param_count == 4)
{
value = cmd->params[3];
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, gaim_url_decode(value));
}
else
{
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, NULL);
else if (!strcmp(type, "MFM")) {
type = cmd->params[1];
gaim_connection_set_display_name(
gaim_account_get_connection(session->account),
gaim_url_decode(cmd->params[2]));
}
}
}
###############################
as third instruction of the void there is
g_return_if_fail(cmd->param_count >= 3);, from whati I understand of this
void, it stop the void procedure if cmd->param_count >= 3.... but after I
see if (cmd->param_count == 4) .... so if it's right the interpretation of
g_return_if_fail the condition that follow never happen! And I also thought
that was incoerent... and so I changed the integer of values.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 04:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

I added the if (!strcmp(type, "MFN")) { in sync.c and notification.c
because it figured out in that files the void prp_cmd... and I thought that
was necessary add the parsing of that instruction... that set the nickname.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 01:17

Message:
Logged In: YES
user_id=159910
Originator: YES

new version, fixes some crashes because group_id is char * but in some
places it's set to an int (!). skadotnet, I don't understand why you need
`if (!strcmp(type, "MFN")) {` in so many places, so I didn't include most
of them. I also have different versions of some of your fixes because I
already fixed them.

Group manipulations may still not work, at least it's not crashing :-)

File Added: msn.tgz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 01:03

Message:
Logged In: YES
user_id=159910
Originator: YES

are you sure that setting the friendly name in msn_notification_post_adl()
is correct?

something is weird, sometimes I get back my own contact information in
contact.c:msn_parse_addressbook(), so I can set the display name there, and
sometimes I don't. It may have something to do with contact list caching.

I will upload a new version soon that fixes lots of compiler warning and
some crashes for group manipulations.


----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-29 20:38

Message:
Logged In: YES
user_id=159910
Originator: YES

I finally figured out why I couldn't sign on, I was missing a */ so a
large block of code was commented out!

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 09:35

Message:
Logged In: YES
user_id=1678429
Originator: NO

I link directly the patch file....
http://skadotnet.altervista.org/msn.patch

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 09:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

This is the patch file for the first 2 fix, it's not complete because it
need the implementation of the field where save the friendly name, now it
use local alias as first display name. It persists the problem of buddy
icon, I'm sorry but more than this I can't do.
Here the patch:
############################################################################################################################################
diff -uN msn.original/msn.c msn/msn.c
--- msn.original/msn.c 2006-12-25 03:29:57.000000000 +0100
+++ msn/msn.c 2006-12-29 16:11:15.000000000 +0100
@@ -137,9 +137,10 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ if (strlen(alias) > 0)
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
+ else
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s",
gaim_url_encode(gaim_account_get_username(account)));
}

static void
@@ -798,6 +799,9 @@

if (!msn_session_connect(session, host, port, http_method))
gaim_connection_error(gc, _("Failed to connect to server."));
+
+ // Transitional pointment to local alias. Should be the friendly name
saved at every change.
+ gaim_connection_set_display_name(gc, gaim_account_get_alias(account));
}

static void
diff -uN msn.original/notification.c msn/notification.c
--- msn.original/notification.c 2006-12-25 00:52:23.000000000 +0100
+++ msn/notification.c 2006-12-29 16:11:15.000000000 +0100
@@ -235,8 +235,9 @@
/* authenticate OK */
const char *friendly = gaim_url_decode(cmd->params[3]);

- gaim_connection_set_display_name(gc, friendly);
-
+ if (g_ascii_strcasecmp(friendly, "1"))
+ gaim_connection_set_display_name(gc, friendly);
+
msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);

// msn_cmdproc_send(cmdproc, "SYN", "%s", "0");
@@ -626,6 +627,29 @@
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;
+
+ GaimAccount *account;
+ account = cmdproc->session->account;
+
+ /*
+ * TODO: save somewhere the friendly name in accounts file, when a new
account is created,
+ * or it's set empty or equal to local alias. When a command PRP
MFN is sent through
+ * prp_cmd method in notification.c and sync.c the field in xml
config file is updated.
+ * This is loaded after login with
gaim_connection_set_display_name(GaimConnection *gc, const char *value)
[msn.c:803-804]
+ * so if we connect throught MSNP8 on USR OK command we overwrite
that field,
+ * if the length isn't equal to "1", else if we connect throught
MSNP11 or higher, on USR OK command
+ * we don't overwrite that field because the params is equals to
"1", and throught the command down here
+ * we set for the first time the saved friendly nickname.
+ */
+ const char *friendly;
+ friendly =
gaim_url_encode(gaim_connection_get_display_name(account->gc));
+
+ if (strlen(friendly) <= 0)
+ friendly = gaim_url_encode(gaim_account_get_username(account));
+
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", friendly);
+
+ gaim_debug_info("Ska","Set friendly name as
%s\n",gaim_url_decode(friendly));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
@@ -1025,12 +1049,16 @@

g_return_if_fail(cmd->param_count >= 3);

- type = cmd->params[2];
+ type = cmd->params[1];

- if (cmd->param_count == 4)
+ if (cmd->param_count == 3)
{
- value = cmd->params[3];
- if (!strcmp(type, "PHH"))
+ value = cmd->params[2];
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -1039,7 +1067,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
diff -uN msn.original/sync.c msn/sync.c
--- msn.original/sync.c 2006-12-25 00:17:41.000000000 +0100
+++ msn/sync.c 2006-12-29 16:11:15.000000000 +0100
@@ -64,7 +64,11 @@

if (cmd->param_count == 2)
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -73,7 +77,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
############################################################################################################################################

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 08:05

Message:
Logged In: YES
user_id=1678429
Originator: NO

I'm modifying the fix for second issue, that also set the display name's
field when you open the dialog for set alias manually

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 05:15

Message:
Logged In: YES
user_id=1678429
Originator: NO

There is also another bug.... all my msn buddies have the same msn icon:
this http://xs210.xs.to/xs210/06525/screenshot1.png

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 05:09

Message:
Logged In: YES
user_id=1678429
Originator: NO

I don't see any other way to solve this... when login server send the
command USR Ok, now there isn't the display name that should be stored on
the server....
I've found, I think, the right location to add this command. File
notification.c at line 625.

From:
#####################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
######################################

To:
######################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

GaimAccount *account;
account = cmdproc->session->account;

msn_cmdproc_send(cmdproc,"PRP","MFN %s",
gaim_url_encode(gaim_account_get_alias(account)));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
################################################


with this fix, now the friendly name is set at startup as the local alias
field's value.
For the old MSNP8 is still enabled the parsing of USR OK answer to look
for the display name... but connecting with MSNP13/14 it finds only the
value "1", because server answer with "USR <transid> OK <email-address> 1
0\r\n". The old parser get the fourth parameter... that now is "1", and set
it as friendly name... but then arrives another USR OK answer that
containst at fourth parameter again the email address, and again it set the
friendly name with the email address.
Using this fix, before the second USR OK answer it set the friendly name
so the second USR OK answer arrives as the old format "USR <transid> OK
<email-address> <friendly-name> 0\r\n".

There are other things to do, because, now it set the local alias, and
when you want manually change the friendly name through the dialog, the
value of textbox is "1", I don't know why.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 17:02

Message:
Logged In: YES
user_id=159910
Originator: YES

ya, I thought about that, but then with MSNP8 you can use your friendly
name that you set from elsewhere, with this it means you can't

anyway, I still need to fix the logon issue before I can do any meaningful
work again.


----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 16:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

For the second "bug", from what I could see from the code, and from
msnpiki, it's a change of commands of the protocol. Before the friendly
name ad login was recieved form USR command, but now as says
http://msnpiki.msnfanatic.com/index.php/MSNP13:Example_Session#Updating_Display_Name
after ADL command we need to send a fisrt PRP command to set the friendly
name, so we need to save somewhere the nickname.
A solution could be use the config file to save this parameter, when the
account is created this field is sat as alias field; then ad after sending
ADL command to get the contact list, send the first PRP MFN, to set first
the nickname with param the value of friendlyname field; and also add a
command to save the friendly nickname's value in the setting file, when is
modified manually throught the dialog.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 13:21

Message:
Logged In: YES
user_id=159910
Originator: YES

actually I _thought_ I fixed the 2nd issue, turns out now I can't log in
anymore :-/ reverting to old gaim code works though, will figure it out
later tonight.

feel free to take a shot

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 12:46

Message:
Logged In: YES
user_id=159910
Originator: YES

I actually have those 2 fixed already, nice job though.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 11:34

Message:
Logged In: YES
user_id=1678429
Originator: NO

I've tried the patch winth gaim svn... it works but there are some
problems with the friendly nickname... when I try to set the nickname, it
disconnect from msn. I've corrected this problem using the new msn command
to set nickname, instead of the obsolate one.

###################################################################
--- msn.c.original 2006-12-28 18:30:12.000000000 +0100
+++ msn.c 2006-12-28 18:30:34.000000000 +0100
@@ -137,9 +137,7 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
}

static void
#########################################################################

Now I'm going to solve the missed nickname's update on connect.



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
SourceForge.net
2007-04-10 00:09:39 UTC
Permalink
Patches item #1621854, was opened at 2006-12-25 04:36
Message generated for change (Comment added) made by bsponline
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ka-Hing Cheung (bsponline)
Assigned to: Sean Egan (seanegan)
Summary: brings soc-2006-msnp13 up to head

Initial Comment:
This tarball brings soc-2006-msnp13 up to head. In addition to that it also fixes a crash with sending offline messages.

I wasn't able to generate a diff against that branch, svn seems to insist on diff'ing against HEAD after I run the merge command. After running `svn merge -r 16309:HEAD https://gaim.svn.sourceforge.net/svnroot/gaim/trunk` on the soc-2006-msnp13 you can replace the msn directory with the attached tarball. The fix for offline messaging is on msn.c:901:

if (!session->oim)
session->oim = msn_oim_new(session)



----------------------------------------------------------------------
Post by SourceForge.net
Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-04-10 01:09

Message:
Logged In: YES
user_id=159910
Originator: YES

I remember he said that he had planned to merge it in once 2.0.0 is out
the door. 2 students also said they were going to file SoC applications on
this, so that may or may not change his plan depending if those
applications are accepted.


----------------------------------------------------------------------

Comment By: Richard Laager (rlaager)
Date: 2007-04-10 00:02

Message:
Logged In: YES
user_id=156487
Originator: NO

I'm commenting here for the record. khc: Have you talked to Sean yet about
any MSNP?? branch he may have? I'd love to see this in a Monotone branch
now that we're public with that.

----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 09:37

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
Post by SourceForge.net
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 09:36

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
Post by SourceForge.net
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-04-01 22:03

Message:
Logged In: YES
user_id=1525231
Originator: NO

Couple patches again:
http://koti.mbnet.fi/simom/gaim-msnp13/markup_escape_psm.diff
PSM needs to be escaped, tooltip rendering fails if PSM had '&' in it.

http://koti.mbnet.fi/simom/gaim-msnp13/currentmedia.diff
Support for showing current media of buddies in buddy list. Tooltip shows
both PSM and current media if they are both set, but status line shows only
current media if it is set (official client behaviour). Note: This patch
already includes escaping of PSM, you don't need markup_escape_psm.diff if
you use this.
I know there are bigger problems at the moment than lack of current media
support, but here it is anyway :)

----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-16 09:18

Message:
Logged In: YES
user_id=1525231
Originator: NO

Two little patches, first one prevents own account to be added as a buddy
to buddylist, and second fixes tooltip messing with status and PSM.

http://koti.mbnet.fi/simom/gaim-msnp13/own-account-as-buddy.diff
http://koti.mbnet.fi/simom/gaim-msnp13/psm-in-tooltip.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-16 06:35

Message:
Logged In: YES
user_id=159910
Originator: YES

A little late, but here is a version that should remember your friendly
name. Also has a fix for a crasher when MSN sends you back:

<faultstring>Need to do full sync. Can't sync deltas Client
has too old a copy for us to do a delta sync</faultstring>

In this case, I make gaim re-request the full contact list/address book.

I haven't look too deeply into the reverse list problem, but I think the
solution would involve caching the reverse list, which may require
extending the privacy api.
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-16 03:30

Message:
Logged In: YES
user_id=159910
Originator: YES

Updated the diff with basically no change, except with simom's icon fix.
The previous diff was broken because some of the files were not added

Had to compress it because of sourceforge file size limit
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-10 20:39

Message:
Logged In: YES
user_id=159910
Originator: YES

uploaded a diff, this diff is unchanged from the last tarball that I
previously uploaded, except that it's against HEAD. This should be a little
easier for most people.

File Added: msn-p13-merge-head.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-07 07:54

Message:
Logged In: YES
user_id=159910
Originator: YES

Another way is to make a SOAP request whenever the friendly name is set,
and set the friendly name every time you sign on, which doesn't fix the
reverse list problem, but does allow the friendly name to persist. I
already have the first part written.

I apologize if my lack of activity wasted you too much time.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-06 11:22

Message:
Logged In: YES
user_id=1525231
Originator: NO

One way too is to ask full contact list and address book every time
(*Changes=NULL in certain function calls), I tried this too, it works but
logging in takes some more time. It actually fixes reverse list -problem
too, but maybe local caching would still be a better solution as it is
planned to work that way and it reduces bandwidth-usage.

----------------------------------------------------------------------

Comment By: Mark Doliner (thekingant)
Date: 2007-03-06 07:09

Message:
Logged In: YES
user_id=20979
Originator: NO

Ooh, that's so rockin'

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-06 07:02

Message:
Logged In: YES
user_id=159910
Originator: YES

I found a way to make the server resend the friendly name every time you
sign on, but I haven't had the time and motivation to finish that.
Hopefully I will find the time to look at your diff this weekend.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-05 16:43

Message:
Logged In: YES
user_id=1525231
Originator: NO

I fixed the icons by adding "b->proto_data = user;" to msn_userlist_load()
in userlist.c (see end of the patch), and Friendly name -issue by caching
it to buddylist and using that if it isn't sent by server. This seems to be
necessary as server sends only changes in information since last time.
Maybe same should be done to reverse list, as now for every buddy in my
list i get 'has you: no' in the tooltip. I also prevented own account to be
added to buddy list. Patch against msn.tgz v2 (the one dated 2006-12-30
09:17) can be found in
http://koti.mbnet.fi/simom/gaim-msnp13/msnp13-friendly-name-and-icons.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 18:54

Message:
Logged In: YES
user_id=159910
Originator: YES

I am heading out, but g_return_if_fail(cmd->param_count >= 3) means if the
condition cmd->param_count >= 3 fails, the function would return right
there. So that part is working as expected. I have no idea why sometimes I
get the friendly name and sometimes I don't.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 11:11

Message:
Logged In: YES
user_id=1678429
Originator: NO

The first two connection I receive after last USR TWN command
USR <tid> OK <email> 1 0
USR <tid2> <email> <a number of three blocks
nnnnnnnnnn.nnnnnnnn.nnnnnnnn>
USR <tid2> OK <email> <displayname>

The third time the last USR OK command is:
USR <tid2> OK <email> <email>

I changed nothing in account's setting, I only connected and disconnected
for three time. VERY strange.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 11:02

Message:
Logged In: YES
user_id=1678429
Originator: NO

Uhm... I'm trying your updated version... with a new profile.... The first
connection, it's all ok... it loads for my contact the right friendly name
from server I think because the local alias is different. I disconnected,
then reconnected, it's ok also this time; again I disconnect and then
reconnect, but at this third time... it doesn't load the friendly name, and
all my msn buddies have the same msn icon
http://xs210.xs.to/xs210/06525/screenshot1.png. :|

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 10:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

And also I see now in prp_cmd method of notification.c your mod...
###############
static void
prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
{
MsnSession *session = cmdproc->session;
const char *type, *value;

g_return_if_fail(cmd->param_count >= 3);

type = cmd->params[2];

if (cmd->param_count == 4)
{
value = cmd->params[3];
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, gaim_url_decode(value));
}
else
{
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, NULL);
else if (!strcmp(type, "MFM")) {
type = cmd->params[1];
gaim_connection_set_display_name(
gaim_account_get_connection(session->account),
gaim_url_decode(cmd->params[2]));
}
}
}
###############################
as third instruction of the void there is
g_return_if_fail(cmd->param_count >= 3);, from whati I understand of this
void, it stop the void procedure if cmd->param_count >= 3.... but after I
see if (cmd->param_count == 4) .... so if it's right the interpretation of
g_return_if_fail the condition that follow never happen! And I also thought
that was incoerent... and so I changed the integer of values.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 10:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

I added the if (!strcmp(type, "MFN")) { in sync.c and notification.c
because it figured out in that files the void prp_cmd... and I thought that
was necessary add the parsing of that instruction... that set the nickname.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 07:17

Message:
Logged In: YES
user_id=159910
Originator: YES

new version, fixes some crashes because group_id is char * but in some
places it's set to an int (!). skadotnet, I don't understand why you need
`if (!strcmp(type, "MFN")) {` in so many places, so I didn't include most
of them. I also have different versions of some of your fixes because I
already fixed them.

Group manipulations may still not work, at least it's not crashing :-)

File Added: msn.tgz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 07:03

Message:
Logged In: YES
user_id=159910
Originator: YES

are you sure that setting the friendly name in msn_notification_post_adl()
is correct?

something is weird, sometimes I get back my own contact information in
contact.c:msn_parse_addressbook(), so I can set the display name there, and
sometimes I don't. It may have something to do with contact list caching.

I will upload a new version soon that fixes lots of compiler warning and
some crashes for group manipulations.


----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 02:38

Message:
Logged In: YES
user_id=159910
Originator: YES

I finally figured out why I couldn't sign on, I was missing a */ so a
large block of code was commented out!

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 15:35

Message:
Logged In: YES
user_id=1678429
Originator: NO

I link directly the patch file....
http://skadotnet.altervista.org/msn.patch

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 15:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

This is the patch file for the first 2 fix, it's not complete because it
need the implementation of the field where save the friendly name, now it
use local alias as first display name. It persists the problem of buddy
icon, I'm sorry but more than this I can't do.
Here the patch:
############################################################################################################################################
diff -uN msn.original/msn.c msn/msn.c
--- msn.original/msn.c 2006-12-25 03:29:57.000000000 +0100
+++ msn/msn.c 2006-12-29 16:11:15.000000000 +0100
@@ -137,9 +137,10 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ if (strlen(alias) > 0)
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
+ else
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s",
gaim_url_encode(gaim_account_get_username(account)));
}

static void
@@ -798,6 +799,9 @@

if (!msn_session_connect(session, host, port, http_method))
gaim_connection_error(gc, _("Failed to connect to server."));
+
+ // Transitional pointment to local alias. Should be the friendly name
saved at every change.
+ gaim_connection_set_display_name(gc, gaim_account_get_alias(account));
}

static void
diff -uN msn.original/notification.c msn/notification.c
--- msn.original/notification.c 2006-12-25 00:52:23.000000000 +0100
+++ msn/notification.c 2006-12-29 16:11:15.000000000 +0100
@@ -235,8 +235,9 @@
/* authenticate OK */
const char *friendly = gaim_url_decode(cmd->params[3]);

- gaim_connection_set_display_name(gc, friendly);
-
+ if (g_ascii_strcasecmp(friendly, "1"))
+ gaim_connection_set_display_name(gc, friendly);
+
msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);

// msn_cmdproc_send(cmdproc, "SYN", "%s", "0");
@@ -626,6 +627,29 @@
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;
+
+ GaimAccount *account;
+ account = cmdproc->session->account;
+
+ /*
+ * TODO: save somewhere the friendly name in accounts file, when a new
account is created,
+ * or it's set empty or equal to local alias. When a command PRP
MFN is sent through
+ * prp_cmd method in notification.c and sync.c the field in xml
config file is updated.
+ * This is loaded after login with
gaim_connection_set_display_name(GaimConnection *gc, const char *value)
[msn.c:803-804]
+ * so if we connect throught MSNP8 on USR OK command we overwrite
that field,
+ * if the length isn't equal to "1", else if we connect throught
MSNP11 or higher, on USR OK command
+ * we don't overwrite that field because the params is equals to
"1", and throught the command down here
+ * we set for the first time the saved friendly nickname.
+ */
+ const char *friendly;
+ friendly =
gaim_url_encode(gaim_connection_get_display_name(account->gc));
+
+ if (strlen(friendly) <= 0)
+ friendly = gaim_url_encode(gaim_account_get_username(account));
+
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", friendly);
+
+ gaim_debug_info("Ska","Set friendly name as
%s\n",gaim_url_decode(friendly));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
@@ -1025,12 +1049,16 @@

g_return_if_fail(cmd->param_count >= 3);

- type = cmd->params[2];
+ type = cmd->params[1];

- if (cmd->param_count == 4)
+ if (cmd->param_count == 3)
{
- value = cmd->params[3];
- if (!strcmp(type, "PHH"))
+ value = cmd->params[2];
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -1039,7 +1067,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
diff -uN msn.original/sync.c msn/sync.c
--- msn.original/sync.c 2006-12-25 00:17:41.000000000 +0100
+++ msn/sync.c 2006-12-29 16:11:15.000000000 +0100
@@ -64,7 +64,11 @@

if (cmd->param_count == 2)
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -73,7 +77,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
############################################################################################################################################

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 14:05

Message:
Logged In: YES
user_id=1678429
Originator: NO

I'm modifying the fix for second issue, that also set the display name's
field when you open the dialog for set alias manually

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 11:15

Message:
Logged In: YES
user_id=1678429
Originator: NO

There is also another bug.... all my msn buddies have the same msn icon:
this http://xs210.xs.to/xs210/06525/screenshot1.png

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 11:09

Message:
Logged In: YES
user_id=1678429
Originator: NO

I don't see any other way to solve this... when login server send the
command USR Ok, now there isn't the display name that should be stored on
the server....
I've found, I think, the right location to add this command. File
notification.c at line 625.

From:
#####################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
######################################

To:
######################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

GaimAccount *account;
account = cmdproc->session->account;

msn_cmdproc_send(cmdproc,"PRP","MFN %s",
gaim_url_encode(gaim_account_get_alias(account)));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
################################################


with this fix, now the friendly name is set at startup as the local alias
field's value.
For the old MSNP8 is still enabled the parsing of USR OK answer to look
for the display name... but connecting with MSNP13/14 it finds only the
value "1", because server answer with "USR <transid> OK <email-address> 1
0\r\n". The old parser get the fourth parameter... that now is "1", and set
it as friendly name... but then arrives another USR OK answer that
containst at fourth parameter again the email address, and again it set the
friendly name with the email address.
Using this fix, before the second USR OK answer it set the friendly name
so the second USR OK answer arrives as the old format "USR <transid> OK
<email-address> <friendly-name> 0\r\n".

There are other things to do, because, now it set the local alias, and
when you want manually change the friendly name through the dialog, the
value of textbox is "1", I don't know why.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 23:02

Message:
Logged In: YES
user_id=159910
Originator: YES

ya, I thought about that, but then with MSNP8 you can use your friendly
name that you set from elsewhere, with this it means you can't

anyway, I still need to fix the logon issue before I can do any meaningful
work again.


----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 22:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

For the second "bug", from what I could see from the code, and from
msnpiki, it's a change of commands of the protocol. Before the friendly
name ad login was recieved form USR command, but now as says
http://msnpiki.msnfanatic.com/index.php/MSNP13:Example_Session#Updating_Display_Name
after ADL command we need to send a fisrt PRP command to set the friendly
name, so we need to save somewhere the nickname.
A solution could be use the config file to save this parameter, when the
account is created this field is sat as alias field; then ad after sending
ADL command to get the contact list, send the first PRP MFN, to set first
the nickname with param the value of friendlyname field; and also add a
command to save the friendly nickname's value in the setting file, when is
modified manually throught the dialog.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 19:21

Message:
Logged In: YES
user_id=159910
Originator: YES

actually I _thought_ I fixed the 2nd issue, turns out now I can't log in
anymore :-/ reverting to old gaim code works though, will figure it out
later tonight.

feel free to take a shot

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 18:46

Message:
Logged In: YES
user_id=159910
Originator: YES

I actually have those 2 fixed already, nice job though.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 17:34

Message:
Logged In: YES
user_id=1678429
Originator: NO

I've tried the patch winth gaim svn... it works but there are some
problems with the friendly nickname... when I try to set the nickname, it
disconnect from msn. I've corrected this problem using the new msn command
to set nickname, instead of the obsolate one.

###################################################################
--- msn.c.original 2006-12-28 18:30:12.000000000 +0100
+++ msn.c 2006-12-28 18:30:34.000000000 +0100
@@ -137,9 +137,7 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
}

static void
#########################################################################

Now I'm going to solve the missed nickname's update on connect.



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
SourceForge.net
2007-04-14 20:16:14 UTC
Permalink
Patches item #1621854, was opened at 2006-12-24 22:36
Message generated for change (Comment added) made by rlaager
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Closed
Resolution: Later
Priority: 5
Private: No
Submitted By: Ka-Hing Cheung (bsponline)
Assigned to: Sean Egan (seanegan)
Summary: brings soc-2006-msnp13 up to head

Initial Comment:
This tarball brings soc-2006-msnp13 up to head. In addition to that it also fixes a crash with sending offline messages.

I wasn't able to generate a diff against that branch, svn seems to insist on diff'ing against HEAD after I run the merge command. After running `svn merge -r 16309:HEAD https://gaim.svn.sourceforge.net/svnroot/gaim/trunk` on the soc-2006-msnp13 you can replace the msn directory with the attached tarball. The fix for offline messaging is on msn.c:901:

if (!session->oim)
session->oim = msn_oim_new(session)



----------------------------------------------------------------------
Comment By: Richard Laager (rlaager)
Date: 2007-04-14 15:16

Message:
Logged In: YES
user_id=156487
Originator: NO

Moved to: http://developer.pidgin.im/ticket/148

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-04-09 19:09

Message:
Logged In: YES
user_id=159910
Originator: YES

I remember he said that he had planned to merge it in once 2.0.0 is out
the door. 2 students also said they were going to file SoC applications on
this, so that may or may not change his plan depending if those
applications are accepted.


----------------------------------------------------------------------

Comment By: Richard Laager (rlaager)
Date: 2007-04-09 18:02

Message:
Logged In: YES
user_id=156487
Originator: NO

I'm commenting here for the record. khc: Have you talked to Sean yet about
any MSNP?? branch he may have? I'd love to see this in a Monotone branch
now that we're public with that.

----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 03:37

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: J.S. (jason_syu)
Date: 2007-04-09 03:36

Message:
Logged In: YES
user_id=1760749
Originator: NO

In function msn_session_sync_users() in file session.c, gaim will throw
SEGFAULT caused by
removing element from the list while iterating the list.
for(bnode = cnode->child; bnode; bnode = bnode->next) {
msn_show_sync_issue(session, b->name, group_name); // bnode may be
removed in this function

So iterating code can be changed to:
...
bnode = cnode->child;
while(bnode != NULL) {
tnode = bnode->next;
....
....
bnode = tnode;
}
...
to avoid using the data structure of removed element.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-04-01 16:03

Message:
Logged In: YES
user_id=1525231
Originator: NO

Couple patches again:
http://koti.mbnet.fi/simom/gaim-msnp13/markup_escape_psm.diff
PSM needs to be escaped, tooltip rendering fails if PSM had '&' in it.

http://koti.mbnet.fi/simom/gaim-msnp13/currentmedia.diff
Support for showing current media of buddies in buddy list. Tooltip shows
both PSM and current media if they are both set, but status line shows only
current media if it is set (official client behaviour). Note: This patch
already includes escaping of PSM, you don't need markup_escape_psm.diff if
you use this.
I know there are bigger problems at the moment than lack of current media
support, but here it is anyway :)

----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-16 04:18

Message:
Logged In: YES
user_id=1525231
Originator: NO

Two little patches, first one prevents own account to be added as a buddy
to buddylist, and second fixes tooltip messing with status and PSM.

http://koti.mbnet.fi/simom/gaim-msnp13/own-account-as-buddy.diff
http://koti.mbnet.fi/simom/gaim-msnp13/psm-in-tooltip.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-16 01:35

Message:
Logged In: YES
user_id=159910
Originator: YES

A little late, but here is a version that should remember your friendly
name. Also has a fix for a crasher when MSN sends you back:

<faultstring>Need to do full sync. Can't sync deltas Client
has too old a copy for us to do a delta sync</faultstring>

In this case, I make gaim re-request the full contact list/address book.

I haven't look too deeply into the reverse list problem, but I think the
solution would involve caching the reverse list, which may require
extending the privacy api.
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-15 22:30

Message:
Logged In: YES
user_id=159910
Originator: YES

Updated the diff with basically no change, except with simom's icon fix.
The previous diff was broken because some of the files were not added

Had to compress it because of sourceforge file size limit
File Added: msn-p13-merge-head.diff.gz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-10 14:39

Message:
Logged In: YES
user_id=159910
Originator: YES

uploaded a diff, this diff is unchanged from the last tarball that I
previously uploaded, except that it's against HEAD. This should be a little
easier for most people.

File Added: msn-p13-merge-head.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-07 01:54

Message:
Logged In: YES
user_id=159910
Originator: YES

Another way is to make a SOAP request whenever the friendly name is set,
and set the friendly name every time you sign on, which doesn't fix the
reverse list problem, but does allow the friendly name to persist. I
already have the first part written.

I apologize if my lack of activity wasted you too much time.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-06 05:22

Message:
Logged In: YES
user_id=1525231
Originator: NO

One way too is to ask full contact list and address book every time
(*Changes=NULL in certain function calls), I tried this too, it works but
logging in takes some more time. It actually fixes reverse list -problem
too, but maybe local caching would still be a better solution as it is
planned to work that way and it reduces bandwidth-usage.

----------------------------------------------------------------------

Comment By: Mark Doliner (thekingant)
Date: 2007-03-06 01:09

Message:
Logged In: YES
user_id=20979
Originator: NO

Ooh, that's so rockin'

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2007-03-06 01:02

Message:
Logged In: YES
user_id=159910
Originator: YES

I found a way to make the server resend the friendly name every time you
sign on, but I haven't had the time and motivation to finish that.
Hopefully I will find the time to look at your diff this weekend.


----------------------------------------------------------------------

Comment By: Simo Mattila (simom)
Date: 2007-03-05 10:43

Message:
Logged In: YES
user_id=1525231
Originator: NO

I fixed the icons by adding "b->proto_data = user;" to msn_userlist_load()
in userlist.c (see end of the patch), and Friendly name -issue by caching
it to buddylist and using that if it isn't sent by server. This seems to be
necessary as server sends only changes in information since last time.
Maybe same should be done to reverse list, as now for every buddy in my
list i get 'has you: no' in the tooltip. I also prevented own account to be
added to buddy list. Patch against msn.tgz v2 (the one dated 2006-12-30
09:17) can be found in
http://koti.mbnet.fi/simom/gaim-msnp13/msnp13-friendly-name-and-icons.diff

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 12:54

Message:
Logged In: YES
user_id=159910
Originator: YES

I am heading out, but g_return_if_fail(cmd->param_count >= 3) means if the
condition cmd->param_count >= 3 fails, the function would return right
there. So that part is working as expected. I have no idea why sometimes I
get the friendly name and sometimes I don't.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 05:11

Message:
Logged In: YES
user_id=1678429
Originator: NO

The first two connection I receive after last USR TWN command
USR <tid> OK <email> 1 0
USR <tid2> <email> <a number of three blocks
nnnnnnnnnn.nnnnnnnn.nnnnnnnn>
USR <tid2> OK <email> <displayname>

The third time the last USR OK command is:
USR <tid2> OK <email> <email>

I changed nothing in account's setting, I only connected and disconnected
for three time. VERY strange.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 05:02

Message:
Logged In: YES
user_id=1678429
Originator: NO

Uhm... I'm trying your updated version... with a new profile.... The first
connection, it's all ok... it loads for my contact the right friendly name
from server I think because the local alias is different. I disconnected,
then reconnected, it's ok also this time; again I disconnect and then
reconnect, but at this third time... it doesn't load the friendly name, and
all my msn buddies have the same msn icon
http://xs210.xs.to/xs210/06525/screenshot1.png. :|

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 04:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

And also I see now in prp_cmd method of notification.c your mod...
###############
static void
prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
{
MsnSession *session = cmdproc->session;
const char *type, *value;

g_return_if_fail(cmd->param_count >= 3);

type = cmd->params[2];

if (cmd->param_count == 4)
{
value = cmd->params[3];
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, gaim_url_decode(value));
}
else
{
if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
else if (!strcmp(type, "PHM"))
msn_user_set_mobile_phone(session->user, NULL);
else if (!strcmp(type, "MFM")) {
type = cmd->params[1];
gaim_connection_set_display_name(
gaim_account_get_connection(session->account),
gaim_url_decode(cmd->params[2]));
}
}
}
###############################
as third instruction of the void there is
g_return_if_fail(cmd->param_count >= 3);, from whati I understand of this
void, it stop the void procedure if cmd->param_count >= 3.... but after I
see if (cmd->param_count == 4) .... so if it's right the interpretation of
g_return_if_fail the condition that follow never happen! And I also thought
that was incoerent... and so I changed the integer of values.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-30 04:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

I added the if (!strcmp(type, "MFN")) { in sync.c and notification.c
because it figured out in that files the void prp_cmd... and I thought that
was necessary add the parsing of that instruction... that set the nickname.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 01:17

Message:
Logged In: YES
user_id=159910
Originator: YES

new version, fixes some crashes because group_id is char * but in some
places it's set to an int (!). skadotnet, I don't understand why you need
`if (!strcmp(type, "MFN")) {` in so many places, so I didn't include most
of them. I also have different versions of some of your fixes because I
already fixed them.

Group manipulations may still not work, at least it's not crashing :-)

File Added: msn.tgz

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-30 01:03

Message:
Logged In: YES
user_id=159910
Originator: YES

are you sure that setting the friendly name in msn_notification_post_adl()
is correct?

something is weird, sometimes I get back my own contact information in
contact.c:msn_parse_addressbook(), so I can set the display name there, and
sometimes I don't. It may have something to do with contact list caching.

I will upload a new version soon that fixes lots of compiler warning and
some crashes for group manipulations.


----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-29 20:38

Message:
Logged In: YES
user_id=159910
Originator: YES

I finally figured out why I couldn't sign on, I was missing a */ so a
large block of code was commented out!

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 09:35

Message:
Logged In: YES
user_id=1678429
Originator: NO

I link directly the patch file....
http://skadotnet.altervista.org/msn.patch

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 09:33

Message:
Logged In: YES
user_id=1678429
Originator: NO

This is the patch file for the first 2 fix, it's not complete because it
need the implementation of the field where save the friendly name, now it
use local alias as first display name. It persists the problem of buddy
icon, I'm sorry but more than this I can't do.
Here the patch:
############################################################################################################################################
diff -uN msn.original/msn.c msn/msn.c
--- msn.original/msn.c 2006-12-25 03:29:57.000000000 +0100
+++ msn/msn.c 2006-12-29 16:11:15.000000000 +0100
@@ -137,9 +137,10 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ if (strlen(alias) > 0)
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
+ else
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s",
gaim_url_encode(gaim_account_get_username(account)));
}

static void
@@ -798,6 +799,9 @@

if (!msn_session_connect(session, host, port, http_method))
gaim_connection_error(gc, _("Failed to connect to server."));
+
+ // Transitional pointment to local alias. Should be the friendly name
saved at every change.
+ gaim_connection_set_display_name(gc, gaim_account_get_alias(account));
}

static void
diff -uN msn.original/notification.c msn/notification.c
--- msn.original/notification.c 2006-12-25 00:52:23.000000000 +0100
+++ msn/notification.c 2006-12-29 16:11:15.000000000 +0100
@@ -235,8 +235,9 @@
/* authenticate OK */
const char *friendly = gaim_url_decode(cmd->params[3]);

- gaim_connection_set_display_name(gc, friendly);
-
+ if (g_ascii_strcasecmp(friendly, "1"))
+ gaim_connection_set_display_name(gc, friendly);
+
msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);

// msn_cmdproc_send(cmdproc, "SYN", "%s", "0");
@@ -626,6 +627,29 @@
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;
+
+ GaimAccount *account;
+ account = cmdproc->session->account;
+
+ /*
+ * TODO: save somewhere the friendly name in accounts file, when a new
account is created,
+ * or it's set empty or equal to local alias. When a command PRP
MFN is sent through
+ * prp_cmd method in notification.c and sync.c the field in xml
config file is updated.
+ * This is loaded after login with
gaim_connection_set_display_name(GaimConnection *gc, const char *value)
[msn.c:803-804]
+ * so if we connect throught MSNP8 on USR OK command we overwrite
that field,
+ * if the length isn't equal to "1", else if we connect throught
MSNP11 or higher, on USR OK command
+ * we don't overwrite that field because the params is equals to
"1", and throught the command down here
+ * we set for the first time the saved friendly nickname.
+ */
+ const char *friendly;
+ friendly =
gaim_url_encode(gaim_connection_get_display_name(account->gc));
+
+ if (strlen(friendly) <= 0)
+ friendly = gaim_url_encode(gaim_account_get_username(account));
+
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", friendly);
+
+ gaim_debug_info("Ska","Set friendly name as
%s\n",gaim_url_decode(friendly));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
@@ -1025,12 +1049,16 @@

g_return_if_fail(cmd->param_count >= 3);

- type = cmd->params[2];
+ type = cmd->params[1];

- if (cmd->param_count == 4)
+ if (cmd->param_count == 3)
{
- value = cmd->params[3];
- if (!strcmp(type, "PHH"))
+ value = cmd->params[2];
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -1039,7 +1067,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
diff -uN msn.original/sync.c msn/sync.c
--- msn.original/sync.c 2006-12-25 00:17:41.000000000 +0100
+++ msn/sync.c 2006-12-29 16:11:15.000000000 +0100
@@ -64,7 +64,11 @@

if (cmd->param_count == 2)
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, gaim_url_decode(value));
+ gaim_connection_set_display_name(session->account->gc,
gaim_url_decode(value));
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, gaim_url_decode(value));
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, gaim_url_decode(value));
@@ -73,7 +77,11 @@
}
else
{
- if (!strcmp(type, "PHH"))
+ if (!strcmp(type, "MFN")) {
+ msn_user_set_friendly_name(session->user, NULL);
+ gaim_connection_set_display_name(session->account->gc, NULL);
+ }
+ else if (!strcmp(type, "PHH"))
msn_user_set_home_phone(session->user, NULL);
else if (!strcmp(type, "PHW"))
msn_user_set_work_phone(session->user, NULL);
############################################################################################################################################

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 08:05

Message:
Logged In: YES
user_id=1678429
Originator: NO

I'm modifying the fix for second issue, that also set the display name's
field when you open the dialog for set alias manually

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 05:15

Message:
Logged In: YES
user_id=1678429
Originator: NO

There is also another bug.... all my msn buddies have the same msn icon:
this http://xs210.xs.to/xs210/06525/screenshot1.png

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-29 05:09

Message:
Logged In: YES
user_id=1678429
Originator: NO

I don't see any other way to solve this... when login server send the
command USR Ok, now there isn't the display name that should be stored on
the server....
I've found, I think, the right location to add this command. File
notification.c at line 625.

From:
#####################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
######################################

To:
######################################
void
msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int
payload_len)
{
MsnTransaction *trans;

GaimAccount *account;
account = cmdproc->session->account;

msn_cmdproc_send(cmdproc,"PRP","MFN %s",
gaim_url_encode(gaim_account_get_alias(account)));

gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
################################################


with this fix, now the friendly name is set at startup as the local alias
field's value.
For the old MSNP8 is still enabled the parsing of USR OK answer to look
for the display name... but connecting with MSNP13/14 it finds only the
value "1", because server answer with "USR <transid> OK <email-address> 1
0\r\n". The old parser get the fourth parameter... that now is "1", and set
it as friendly name... but then arrives another USR OK answer that
containst at fourth parameter again the email address, and again it set the
friendly name with the email address.
Using this fix, before the second USR OK answer it set the friendly name
so the second USR OK answer arrives as the old format "USR <transid> OK
<email-address> <friendly-name> 0\r\n".

There are other things to do, because, now it set the local alias, and
when you want manually change the friendly name through the dialog, the
value of textbox is "1", I don't know why.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 17:02

Message:
Logged In: YES
user_id=159910
Originator: YES

ya, I thought about that, but then with MSNP8 you can use your friendly
name that you set from elsewhere, with this it means you can't

anyway, I still need to fix the logon issue before I can do any meaningful
work again.


----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 16:40

Message:
Logged In: YES
user_id=1678429
Originator: NO

For the second "bug", from what I could see from the code, and from
msnpiki, it's a change of commands of the protocol. Before the friendly
name ad login was recieved form USR command, but now as says
http://msnpiki.msnfanatic.com/index.php/MSNP13:Example_Session#Updating_Display_Name
after ADL command we need to send a fisrt PRP command to set the friendly
name, so we need to save somewhere the nickname.
A solution could be use the config file to save this parameter, when the
account is created this field is sat as alias field; then ad after sending
ADL command to get the contact list, send the first PRP MFN, to set first
the nickname with param the value of friendlyname field; and also add a
command to save the friendly nickname's value in the setting file, when is
modified manually throught the dialog.

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 13:21

Message:
Logged In: YES
user_id=159910
Originator: YES

actually I _thought_ I fixed the 2nd issue, turns out now I can't log in
anymore :-/ reverting to old gaim code works though, will figure it out
later tonight.

feel free to take a shot

----------------------------------------------------------------------

Comment By: Ka-Hing Cheung (bsponline)
Date: 2006-12-28 12:46

Message:
Logged In: YES
user_id=159910
Originator: YES

I actually have those 2 fixed already, nice job though.

----------------------------------------------------------------------

Comment By: Michele Scandale (skadotnet)
Date: 2006-12-28 11:34

Message:
Logged In: YES
user_id=1678429
Originator: NO

I've tried the patch winth gaim svn... it works but there are some
problems with the friendly nickname... when I try to set the nickname, it
disconnect from msn. I've corrected this problem using the new msn command
to set nickname, instead of the obsolate one.

###################################################################
--- msn.c.original 2006-12-28 18:30:12.000000000 +0100
+++ msn.c 2006-12-28 18:30:34.000000000 +0100
@@ -137,9 +137,7 @@
return;
}

- msn_cmdproc_send(cmdproc, "REA", "%s %s",
- gaim_account_get_username(account),
- alias);
+ msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
}

static void
#########################################################################

Now I'm going to solve the missed nickname's update on connect.



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1621854&group_id=235

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Loading...