Fix purple_conversation_manager_find_chat_by_id.

Review Request #1495 — Created June 7, 2022 and submitted

Information

pidgin/pidgin
default

Reviewers

purple_conversation_manager_find_chat_by_id was calling
purple_conversation_manager_find_internal with a name of NULL. However,
purple_conversation_manager_find_internal was always requring the conversation
name to matched what was passed in.
Therefore purple_conversation_manager_find_chat_by_id never actually worked.

Connected an IRC account and successfully sent a message.

Summary ID
Fix purple_conversation_manager_find_chat_by_id.
purple_conversation_manager_find_chat_by_id was calling purple_conversation_manager_find_internal with a name of NULL. However, purple_conversation_manager_find_internal was always requring the conversation name to matched what was passed in. Therefore purple_conversation_manager_find_chat_by_id never actually worked.
5aa0160d757e1b013b4a7b3e184fc30ad7a058ca
Description From Last Updated

You might want to put if(func == NULL) return NULL; outside the while loop and remove the check from inside …

belginbelgin

If account and conversation are both NULL, func is called with NULL as its first argument. I would check if …

belginbelgin
belgin
  1. 
      
  2. libpurple/purpleconversationmanager.c (Diff revision 1)
     
     
    Show all issues

    You might want to put if(func == NULL) return NULL; outside the while loop and remove the check from inside it.

    1. That's not quite the same thing, but I'll restore the old setup to make it easier to read.

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

    If account and conversation are both NULL, func is called with NULL as its first argument.

    I would check if account is non-NULL before the while loop and return early if it is.

    1. conversation is verfied to not be null in purple_conversation_manager_register before it is inserted into the hash table.

      Also callers of purple_conversation_manager_find_internal are already verifying that account is non-null.

  4. 
      
grim
ivanhoe
  1. Ship It!
  2. 
      
belgin
  1. Ship It!
  2. 
      
grim
Review request changed
Status:
Completed