Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,9 @@ def parse_group_direct_messages(username, users, user_id_url_template, paths):
group_conversations_metadata[conversation_id]['participant_names'] = participant_names
group_conversations_metadata[conversation_id]['conversation_names'] = [(0, conversation_id)]
group_conversations_metadata[conversation_id]['participant_message_count'] = defaultdict(int)
for participant_id in participants:
# init every participant's message count with 0, so that users with no activity are not ignored
group_conversations_metadata[conversation_id]['participant_message_count'][participant_id] = 0
messages = []
if 'messages' in dm_conversation:
for message in dm_conversation['messages']:
Expand Down Expand Up @@ -1156,6 +1159,8 @@ def parse_group_direct_messages(username, users, user_id_url_template, paths):
participant_handle = users[participant_id].handle
if participant_handle != username:
handles.append((participant_handle, message_count))
# sort alphabetically by handle first, for a more deterministic order
handles.sort(key=lambda tup: tup[0])
# sort so that the most active users are at the start of the list
handles.sort(key=lambda tup: tup[1], reverse=True)
if len(handles) == 1:
Expand Down