Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#10542 closed patch (fixed)

GG 8.0 support in Pidgin 2.6.x

Reported by: kkszysiu Owned by: bartosz
Milestone: 2.7.0 Component: Gadu-Gadu
Version: 2.6.2 Keywords: gadu
Cc: belegdol, raven, gbula

Description

Hello. Today I want to share my patches that will add support for Gadu-Gadu 8.0 protocol with features like:

  • UTF8 support
  • New DND status
  • Length of statuses increased to 1024 bytes
  • Many bugfixes

It needs to patch internal libgadu library included in Pidgin to 1.9.0 but I made that. All other changes I made too so we have teoretically full-featured GG 8.0 protocol support (just without audio/video, graphical descriptions and other strange stuff) but I'm not sure it can be compiled in Windows now and other change is that I need to add to configure script something like "if libgadu version is lower that 1.9.0 then use integral libgadu from Pidgin sources". Is that possible? And could anyone test compilation with my patches on Windows?

Attachments (11)

pidgin_gg80.patch (654.3 KB) - added by kkszysiu 10 years ago.
pidgin_gg80_path2.patch (531.1 KB) - added by kkszysiu 10 years ago.
gg_changes.patch (39.3 KB) - added by rekkanoryo 9 years ago.
Sum of all changes we have made to libgadu
pidgin_gg80_patch3.patch (367.5 KB) - added by tomkiewicz 9 years ago.
pidgin_gg80_path2.patch with resolved conflicts
events_c_patch (161 bytes) - added by kkszysiu 9 years ago.
libgadu_h_patch (32 bytes) - added by kkszysiu 9 years ago.
libgadu_c_patch (190 bytes) - added by kkszysiu 9 years ago.
resolver_c_patch (8.2 KB) - added by kkszysiu 9 years ago.
gg_update_4.patch (15.2 KB) - added by kkszysiu 9 years ago.
gg_update_5.patch (21.7 KB) - added by kkszysiu 9 years ago.
gg_patch6.patch (3.7 KB) - added by kkszysiu 9 years ago.

Download all attachments as: .zip

Change History (67)

Changed 10 years ago by kkszysiu

comment:1 Changed 10 years ago by kkszysiu

Anuone could review it, please?

comment:2 follow-up: Changed 10 years ago by MarkS

Related to Pidgin ticket #373

comment:3 in reply to: ↑ 2 Changed 10 years ago by kkszysiu

Replying to MarkS:

Related to Pidgin ticket #373

It's just related. Yes I've updated libgadu but I made some changes in Pidgin's GG protocol implementation.

Changed 10 years ago by kkszysiu

comment:4 Changed 10 years ago by kkszysiu

In pidgin_gg80_path2.patch I removed all non-neccessary stuff. I forgot to delete .deps folder etc, sorry about that.

comment:5 Changed 10 years ago by darkrain42

  • Milestone set to Patches Needing Review
  • Type changed from enhancement to patch

comment:6 Changed 9 years ago by teddy_beer_maniac

The patch works correctly in 2.6.2 and 2.6.3: I can send and receive UTF-8 characters in messages and status descriptions, set and see others' DND status, longer status messages are working too. Checked using official GG8 client.

The only feature that is missing is FFC status.

comment:7 Changed 9 years ago by teddy_beer_maniac

Oh, I didn't notice that you were asking for testing the patch on Windows. I was testing it on Linux.

comment:8 Changed 9 years ago by phaber

unfortunately it does not compile under windows
seems the original libgadu (libgadu.c 16856 2006-08-19 01:13:25Z) was extensively patched to compile under MinGW

comment:9 Changed 9 years ago by rekkanoryo

Several comments:

  • Does not apply cleanly for me against source as stored in monotone. It should be remade against the monotone repository. Patch creates the following rejects (the corresponding .c files have the conflicts):
    • ./gg/lib/common.c.rej
    • ./gg/lib/dcc.c.rej
    • ./gg/lib/events.c.rej
    • ./gg/lib/http.c.rej
    • ./gg/lib/libgadu.c.rej
    • ./gg/lib/pubdir50.c.rej
    • ./gg/lib/pubdir.c.rej
  • Incorrectly changes the address of the Free Software Foundation to an old address. The version throughout the Pidgin and libpurple source is the correct address.
  • Incorrectly includes Makefile and Makefile.in files. Only Makefile.am should be touched by patches. This would be resolved simply by developing the patch against the source in our monotone repository.

comment:10 Changed 9 years ago by rekkanoryo

  • Milestone changed from Patches Needing Review to Patches Needing Improvement

comment:11 Changed 9 years ago by rekkanoryo

Additionally, there are // comments throughout the code. While gcc will accept these comments, we don't allow them. That should also be corrected in an updated patch.

comment:12 Changed 9 years ago by kkszysiu

Yeah but thats not the most important thing to fix. The most important thing is that it cant be compiled under Windows and I dont know how to fix it. I dont have Windows and I cant even test it :/

comment:13 Changed 9 years ago by darkrain42

If you figure out what version of gadu-gadu is currently bundled with Pidgin, take a diff of what we currently have to what shipped (as the vanilla gadu-gadu release) and then apply that on top of the newer gadu gadu. That should at least fix some of the build issues.

comment:14 Changed 9 years ago by rekkanoryo

I've attached a patch that includes the sum of all changes from the point libgadu was inserted into our tree on 2005-08-28.

Changed 9 years ago by rekkanoryo

Sum of all changes we have made to libgadu

comment:15 Changed 9 years ago by fraku

Can anyone convert those patch to plugin ? I'd like to install it on Windows.

comment:16 Changed 9 years ago by kkszysiu

It's impossible. Those patches wont work on Windows.

comment:17 Changed 9 years ago by rekkanoryo

Ticket #9365 has been marked as a duplicate of this ticket.

comment:18 Changed 9 years ago by rekkanoryo

Ticket #11039 has been marked as a duplicate of this ticket.

comment:19 Changed 9 years ago by deryni

Ticket #11417 has been marked as a duplicate of this ticket.

comment:20 Changed 9 years ago by rekkanoryo@…

(In 3e11646a9e21dbb7eae8d07d2782cac0c85fa2c0):
Update our internal libgadu to 1.9.0-rc2. This does not yet build on Windows. Refs #10542. The Windows build errors are the only reason this isn't on im.pidgin.pidgin already.

comment:21 Changed 9 years ago by kkszysiu

Do you have Windows build enviroment? I could patch that if you want but for now I can't compile Pidgin on Windows even without that patches. :/

comment:22 Changed 9 years ago by rekkanoryo

Yes, I have a functional build environment. It's not the prettiest of things since it has some old junk laying around, but it works.

comment:23 Changed 9 years ago by rekkanoryo

Oh, I should also note that the patch I posted that includes all our old libgadu changes does not apply cleanly, and there may be more issues than appear on the surface because I had to make some minor tweaks to get libgadu building within our tree.

comment:24 Changed 9 years ago by kkszysiu

Could you pack that build enviroment and upload somewhere, please? I'm not sure what size it will have but maybe will be small enough to up it somewhere?

comment:25 Changed 9 years ago by rekkanoryo

  • Milestone changed from Patches Needing Improvement to 2.7.0

My build environment is over 190 MB. There is a build fetcher script that will properly construct a Windows build environment linked to from the BuildingWinPidgin page, and there are only minor updates to libxml2 and GTK+, glib, and friends required to update said constructed environment to be capable of building im.pidgin.pidgin and im.pidgin.cpw.rekkanoryo.ggupdate.

comment:26 Changed 9 years ago by rekkanoryo@…

(In 6f6e595b90a5219711898b80e49ca2ee8f781ed3):
Partially fix libgadu build on Win32. Refs #10542. I'm still not sure how to handle all the stuff in resolver.c for DNS resolution. I couldn't quite see how to reconcile our earlier stuff with this new code. Hopefully a more skilled Win32 developer can finish this.

comment:27 Changed 9 years ago by rekkanoryo@…

(In d21119dede49bb8c2a1cfb45634f4d976f6f0e8b):
Oops, I forgot this. This is done internally in libgadu, and not doing it produces a ton of warnings in libgadu itself. This does have the unfortunate side effect of masking the warnings in our Gadu-Gadu prpl, but we can worry about that once this stuff works everywhere we need it to. Refs #10542.

comment:28 Changed 9 years ago by rekkanoryo

Ticket #11465 has been marked as a duplicate of this ticket.

comment:29 Changed 9 years ago by kkszysiu

Heh, it's time to look at it and make it works now.

comment:30 Changed 9 years ago by tomkiewicz

I have resolved conflicts just to make it compile. Unfortunately, it doesn't seems to be "fully-featured GG 8.0 protocol support" - file transfer, image transfer and avatars doesn't work for me.

Changed 9 years ago by tomkiewicz

pidgin_gg80_path2.patch with resolved conflicts

comment:31 Changed 9 years ago by kkszysiu

Conflicts? You mean it could be compiled into Windows platform? File/image transfer didn't work but I don't use it and it's feature from GG 7 protocol. Avatars should work. I've commited patch to version 2.6.6.

comment:32 Changed 9 years ago by tomkiewicz

As rekkanoryo said, your patch (pidgin_gg80_path2.patch) doesn't apply cleanly against 2.6.6 release - it causes some rejects. I fixed that and some other things: incorrectly added Makefile, some removed Windows ifdefs, and some incorrectly changed Free Software Foundation addresses.

Unfortunately, I cannot check, if it compiles properly for Windows platform.

comment:33 Changed 9 years ago by rekkanoryo

The original patch attached to this ticket is now irrelevant. I have applied libgadu 1.9.0-rc2 in-tree and the only thing left to fix is DNS resolving for Windows. That is the only thing that needs to be done prior to merging the work back to im.pidgin.pidgin for release.

comment:34 Changed 9 years ago by kkszysiu

Ookay. I fixed problems with resolver and some crashes on Windows/Linux? but it's still a bit crashy. I need to write some more patches (mostly for Windows build) but could you put that on ggupdate branch, please?

Changed 9 years ago by kkszysiu

Changed 9 years ago by kkszysiu

Changed 9 years ago by kkszysiu

Changed 9 years ago by kkszysiu

comment:35 Changed 9 years ago by rekkanoryo

These patches don't make sense. Can you either regenerate the diffs in unified format (diff -u), or (preferably) generate them with 'mtn diff'?

comment:36 Changed 9 years ago by kkszysiu

No problem. That's from mtn diff.

Changed 9 years ago by kkszysiu

comment:37 Changed 9 years ago by kkszysiu

Forget about gg_update_4.patch. Theres most recent gg_update_5.patch with all changes from gg_update_4.patch + something new.

Changed 9 years ago by kkszysiu

comment:38 Changed 9 years ago by kkszysiu@…

  • Resolution set to fixed
  • Status changed from new to closed

(In ac8ee7f3a708dfc1481e15258fe9b5c71a7920e7):
Finish making libgadu compile on Windows. Fixes #10542 finally!

comment:39 Changed 9 years ago by rekkanoryo

I have merged this back to im.pidgin.pidgin for inclusion in the 2.7.0 release. There may be some configure.ac tweaking needed, but I don't think that's a show-stopper.

comment:40 Changed 9 years ago by qulogic@…

(In 87b17dbaabb71cb46ea5e7a233125baa6ab180a8):
Only accept libgadu >= 1.9.0-rc2 when using pkg-config.

Refs #10542.

comment:41 Changed 9 years ago by qulogic@…

(In 60c9671daa2b521f9de4c0980f8798876959570e):
Don't use old versions of libgadu if the user specified a location for the headers/libraries. GG_DEFAULT_PROTOCOL_VERSION seemed the best bet since GG_LIBGADU_VERSION is a string, but maybe someone can find something that's better.

Refs #10542.

comment:42 Changed 9 years ago by rekkanoryo@…

(In b3973cf6cdd579f554b216e761247fe47d96045a):
Properly display "no" in the configure output when not using external libgadu. Refs #10542.

comment:43 Changed 9 years ago by rekkanoryo

I think this pretty much concludes all the tweaking that was necessary. The updated Gadu-Gadu code should be release ready at this point.

comment:44 Changed 9 years ago by MarkS

Well libgadu has been updated once again. The absolute current version is 1.9.0 RC3 which was released on March 9, 2010 . This issue was reported in reference to 373. Looking at other gadu tickets, I believe this ticket can be possibly closed 6917

comment:45 Changed 9 years ago by MarkS

I actually mean to say ticket:343 and not ticket:6917 can possibly be closed as well.

comment:46 Changed 9 years ago by rekkanoryo

Ticket #373 has been marked as a duplicate of this ticket.

comment:47 Changed 9 years ago by rekkanoryo

kkszysiu, I looked at this diff, and it doesn't look like the changes between -rc2 and -rc3 are all that big. Do you think it's worth trying to apply those changes, or would we be better off waiting until 1.9.0 is finalized and just grabbing the sum of all changes between rc2 and final?

comment:48 Changed 9 years ago by kkszysiu

We should wait for stable release. Theres nothing important for us between rc2 and rc3. rc3 bring to us just some changes, mostly in docs/tests. Thats not important for us :)

comment:49 Changed 9 years ago by rekkanoryo@…

(In e6348335d02982e12c2be1a30517d7ea46569c51):
Pluck authorized by Zac West:

* Plucked 3e11646a9e21dbb7eae8d07d2782cac0c85fa2c0 (rekkanoryo@…): Update our internal libgadu to 1.9.0-rc2. This does not yet build on Windows. Refs #10542. The Windows build errors are the only reason this isn't on im.pidgin.pidgin already.

comment:50 Changed 9 years ago by rekkanoryo@…

(In 48c2553ef4b46482b26f021c97d2569c1b053227):
Plucks authorized by Zac West:

* Plucked 6f6e595b90a5219711898b80e49ca2ee8f781ed3 (rekkanoryo@…): Partially fix libgadu build on Win32. Refs #10542. I'm still not sure how to handle all the stuff in resolver.c for DNS resolution. I couldn't quite see how to reconcile our earlier stuff with this new code. Hopefully a more skilled Win32 developer can finish this.

* Plucked d21119dede49bb8c2a1cfb45634f4d976f6f0e8b (rekkanoryo@…): Oops, I forgot this. This is done internally in libgadu, and not doing it produces a ton of warnings in libgadu itself. This does have the unfortunate side effect of masking the warnings in our Gadu-Gadu prpl, but we can worry about that once this stuff works everywhere we need it to. Refs #10542.

* Plucked ac8ee7f3a708dfc1481e15258fe9b5c71a7920e7 (kkszysiu@…): Finish making libgadu compile on Windows. Fixes #10542 finally!

comment:51 Changed 9 years ago by rekkanoryo@…

(In 96a41ffb59d945d2fe01cdc5141640f84ce189aa):
Manually apply a revision that wouldn't pluck cleanly, then pluck more; pluck authorized by Zac West.

* Manual-apply 60c9671daa2b521f9de4c0980f8798876959570e (qulogic@…): Don't use old versions of libgadu if the user specified a location for the headers/libraries. GG_DEFAULT_PROTOCOL_VERSION seemed the best bet since GG_LIBGADU_VERSION is a string, but maybe someone can find something that's better.

Refs #10542.

* Plucked 87b17dbaabb71cb46ea5e7a233125baa6ab180a8 (qulogic@…): Only accept libgadu >= 1.9.0-rc2 when using pkg-config.

Refs #10542.

* Plucked b3973cf6cdd579f554b216e761247fe47d96045a (rekkanoryo@…): Properly display "no" in the configure output when not using external libgadu. Refs #10542.

comment:52 Changed 9 years ago by rekkanoryo

Ticket #11626 has been marked as a duplicate of this ticket.

comment:53 Changed 9 years ago by Robby

Great effort, John! :)

comment:54 Changed 9 years ago by kkszysiu

Another patch. Well a bit screwed up. Why? Because I don't understand why I got (null) instead of NULL in msg and I needed to use something like that:

if(strcmp(msg, "(null)") == 0) {

purple_prpl_got_user_status(purple_connection_get_account(gc),

from, st, NULL);

} else {

purple_debug_info("gg", "descr = %s\n", msg); purple_prpl_got_user_status(purple_connection_get_account(gc),

from, st, "message", msg, NULL);

}

Could anyone help me with investigate it? :P

Changed 9 years ago by kkszysiu

comment:55 Changed 9 years ago by darkrain42

This actually won't work. You need to explicitly check if descr == NULL.

The reason it won't work is that this code segfaults on Windows:

const char *whatever = g_strdup_printf("%s", NULL);

On other platforms, it returns "(null)".

comment:56 Changed 9 years ago by darkrain42

rekkanoryo points out that that crash won't happen as of 2.7.0 on Windows.

Anyway, instead of matching on "(null)", try changing that loop to look like:

if (descr == NULL)
 purple_prpl_got_user_status(purple_connection_get_account(gc), 
       from, st, NULL); 
} else { 
 purple_debug_info("gg", "descr = %s\n", descr); 
 purple_prpl_got_user_status(purple_connection_get_account(gc), 
     from, st, "message", descr, NULL);
}

(and get rid of msg altogether)

Also, in the future, please file new tickets for patches (just so they can be tracked properly)

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!