parse_message_history

Function parse_message_history 

Source
fn parse_message_history(term: Term, current_user: &str) -> Result<Vec<Message>>
Expand description

Parse message history from Erlang RPC response.

Expected format from backend:

{ok, [
  {FromUser, ToUser, Message, {{Y,M,D},{H,Min,S}}, ServerHost, ServerPort},
  ...
]}

§Arguments

  • term - EETF Term containing the response
  • current_user - Username of the current user to determine sent/received

§Returns

Vector of Message structs ordered by timestamp

§Errors

Returns error if the term format is invalid or parsing fails