fix(messages): correct avatar path (/static/ not /static/uploads/), use last_active_at for presence, add last_active_at to members API
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f6b9b9154f
commit
131e6f0118
@ -88,7 +88,7 @@ def _conversation_list_json(db, membership):
|
||||
u = other_members[0].user
|
||||
display_name = u.name or u.email.split('@')[0]
|
||||
if u.avatar_path:
|
||||
avatar_url = '/static/uploads/' + u.avatar_path
|
||||
avatar_url = '/static/' + u.avatar_path
|
||||
|
||||
# Online status for 1:1 conversations
|
||||
is_online = False
|
||||
@ -202,7 +202,7 @@ def conversations_page():
|
||||
'id': current_user.id,
|
||||
'name': current_user.name or current_user.email.split('@')[0],
|
||||
'email': current_user.email,
|
||||
'avatar_url': ('/static/uploads/' + current_user.avatar_path) if current_user.avatar_path else None,
|
||||
'avatar_url': ('/static/' + current_user.avatar_path) if current_user.avatar_path else None,
|
||||
}
|
||||
|
||||
return render_template(
|
||||
@ -394,7 +394,7 @@ def api_conversation_detail(conv_id):
|
||||
|
||||
avatar_url = None
|
||||
if m.user.avatar_path:
|
||||
avatar_url = '/static/uploads/' + m.user.avatar_path
|
||||
avatar_url = '/static/' + m.user.avatar_path
|
||||
members_list.append({
|
||||
'user_id': m.user_id,
|
||||
'name': m.user.name or m.user.email.split('@')[0],
|
||||
@ -403,6 +403,7 @@ def api_conversation_detail(conv_id):
|
||||
'company_name': company_name,
|
||||
'role': m.role,
|
||||
'last_read_at': m.last_read_at.isoformat() if m.last_read_at else None,
|
||||
'last_active_at': m.user.last_active_at.isoformat() if m.user.last_active_at else (m.user.last_login.isoformat() if m.user.last_login else None),
|
||||
'is_online': is_user_online(m.user_id),
|
||||
})
|
||||
|
||||
|
||||
@ -389,8 +389,8 @@
|
||||
if (other && other.is_online) {
|
||||
subtitle.innerHTML = '<span class="online-status-dot"></span> online';
|
||||
subtitle.classList.add('is-online');
|
||||
} else if (other && other.last_read_at) {
|
||||
subtitle.textContent = formatPresence(other.last_read_at);
|
||||
} else if (other && (other.last_active_at || other.last_read_at)) {
|
||||
subtitle.textContent = formatPresence(other.last_active_at || other.last_read_at);
|
||||
} else {
|
||||
subtitle.textContent = '';
|
||||
}
|
||||
@ -1477,8 +1477,8 @@
|
||||
if (other && other.is_online) {
|
||||
subtitle.innerHTML = '<span class="online-status-dot"></span> online';
|
||||
subtitle.classList.add('is-online');
|
||||
} else if (other && other.last_read_at) {
|
||||
subtitle.textContent = formatPresence(other.last_read_at);
|
||||
} else if (other && (other.last_active_at || other.last_read_at)) {
|
||||
subtitle.textContent = formatPresence(other.last_active_at || other.last_read_at);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user