Modernize PurpleProtocol

Review Request #552 — Created March 3, 2021 and submitted

Information

pidgin/pidgin
default
12b391973a1d

Reviewers

  • Migrate PurpleProtocol to the G_DECLARE_DERIVABLE_TYPE and G_DEFINE_TYPE macros.
  • Rename purple_protocol_class_* to purple_protocol_*.
  • Move the class properties to instance properties and add accessors as necessary.

Ran locally and connected with bonjour, facebook, irc, and xmpp. Verified that the other prpls are loading and visible in the account manager.

Description From Last Updated

The initial g_return_if_fail checks in the old protocol_class methods might be causing issues. I had to remove the PURPLE_IS_ACCOUNT check …

grimgrim

Frees

QuLogicQuLogic

Should use this in the boxed type registration for consistency.

QuLogicQuLogic

These docs need to move into PurpleProtocolClass.

QuLogicQuLogic

Should this be purple_protocol_get_status_types?

QuLogicQuLogic

And purple_protocol_get_list_icon?

QuLogicQuLogic

Doesn't seem to be read from anything?

QuLogicQuLogic

Seems this need finishing.

QuLogicQuLogic

Tabs

QuLogicQuLogic

Tabs

QuLogicQuLogic

Tabs

QuLogicQuLogic

Extra parens around the g_object_new call.

QuLogicQuLogic

Extra parens around g_object_new.

QuLogicQuLogic

This might leak as the condition is composite.

QuLogicQuLogic

This might leak as the condition is composite.

QuLogicQuLogic

As this is a bit flag check in a composite, I would add an extra set of parentheses here.

QuLogicQuLogic
grim
  1. 
      
  2. Show all issues

    The initial g_return_if_fail checks in the old protocol_class methods might be causing issues. I had to remove the PURPLE_IS_ACCOUNT check from list_icon because the Add/Edit Account dialog was calling it with account set to NULL. However, trying to test all these methods is very tedious but I'll look more into it shortly.

    1. Followed all the paths and get_list_icon was the only one that needed it as all the other functions only have a single caller.

  3. 
      
QuLogic
  1. 
      
  2. libpurple/buddyicon.h (Diff revision 1)
     
     
    Show all issues

    Frees

  3. libpurple/buddyicon.c (Diff revision 1)
     
     
    Show all issues

    Should use this in the boxed type registration for consistency.

  4. libpurple/protocol.h (Diff revision 1)
     
     
     
     
     
    Show all issues

    These docs need to move into PurpleProtocolClass.

  5. libpurple/protocol.h (Diff revision 1)
     
     
    Show all issues

    Should this be purple_protocol_get_status_types?

    1. probably, but I didn't want to add more noise right now.

    2. Turns out the noise was nothing as we already renamed the function.. sorry for being dense ;)

  6. libpurple/protocol.h (Diff revision 1)
     
     
    Show all issues

    And purple_protocol_get_list_icon?

  7. libpurple/protocol.c (Diff revision 1)
     
     
    Show all issues

    Doesn't seem to be read from anything?

  8. libpurple/protocols/gg/gg.c (Diff revision 1)
     
     
    Show all issues

    Seems this need finishing.

    1. kind of.. it's weird, but I put a NULL check into ggp_servconn_setup to make it work.

  9. libpurple/protocols/null/nullprpl.c (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Tabs

    1. The entire file is 2 space tab indent and my editor just continued it. I can reformat it in pieces now or we can do it as a separate pr.

    2. These are complete functions, so I don't think it's a problem to add them with the right style. That also means the next PR fixing things will be smaller. Plus the code that was moved here was already using tabs.

  10. libpurple/protocols/null/nullprpl.c (Diff revision 1)
     
     
     
     
    Show all issues

    Tabs

    1. This function is already using tabs.

  11. libpurple/protocols/null/nullprpl.c (Diff revision 1)
     
     
     
     
     
     
     
    Show all issues

    Tabs

  12. libpurple/tests/test_protocol_attention.c (Diff revision 1)
     
     
     
     
     
    Show all issues

    Extra parens around the g_object_new call.

  13. libpurple/tests/test_protocol_xfer.c (Diff revision 1)
     
     
     
     
     
    Show all issues

    Extra parens around g_object_new.

  14. pidgin/gtkaccount.c (Diff revision 1)
     
     
    Show all issues

    This might leak as the condition is composite.

  15. pidgin/gtkaccount.c (Diff revision 1)
     
     
    Show all issues

    This might leak as the condition is composite.

  16. pidgin/gtkblist.c (Diff revision 1)
     
     
    Show all issues

    As this is a bit flag check in a composite, I would add an extra set of parentheses here.

  17. 
      
grim
grim
grim
QuLogic
  1. Ship It!
  2. 
      
grim
Review request changed
Status:
Completed