def chats(cursor):
    """Returns a dict of chats that form (ROWID, guid) pairs."""
    sql_chats = cursor.execute("SELECT ROWID, guid FROM chat").fetchall()
    all_chats = dict()

    for chat in sql_chats:
        rowid, guid = chat
        all_chats[rowid] = guid

    return all_chats