Convert idle_time in PurplePresence to GDateTime

Review Request #2235 — Created Feb. 13, 2023 and submitted

Information

pidgin/pidgin
default

Reviewers

Convert idle_time in PurplePresence to GDateTime

Ran the unit tests and checked a few things in the UI. Noticed that the status time in the buddy list has been broken for some time as well.

Summary ID
Convert idle_time in PurplePresence to GDateTime
6c7dd5bcac26ce765238c0d791d51a53e8eee8d3
Description From Last Updated

Maybe this should mention now that it also can return %NULL.

ivanhoeivanhoe

Doesn't this need to be g_date_time_unref'd in the finalize function?

ivanhoeivanhoe
grim
ivanhoe
  1. 
      
  2. libpurple/purplepresence.h (Diff revision 2)
     
     

    Maybe this should mention now that it also can return %NULL.

  3. libpurple/purplepresence.c (Diff revision 2)
     
     

    Doesn't this need to be g_date_time_unref'd in the finalize function?

  4. libpurple/purplepresence.c (Diff revision 2)
     
     

    Could make idle1 and idle2 const to signify we don't own the memory they are pointing to.

    1. Adding that spews warnings like so

      ../libpurple/purplepresence.c:547:45: warning: passing argument 2 of ‘g_date_time_difference’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
        547 |         diff1 = g_date_time_difference(now, idle1);
            |                                             ^~~~~
      

      But you did make me notice that we should be using idle1 and idle2 below instead of asking the presence's for their idle times again :)

    2. When I made the comment idle1 and idle2 weren't passed to g_date_time_difference ;)

  5. 
      
grim
ivanhoe
  1. Ship It!
  2. 
      
grim
Review request changed

Status: Closed (submitted)

Loading...