% dependencies
\usepackage{pbox}
\usepackage{fancybox}

% commands
\newcommand{\messagebubbleleft}[2]{

  \begin{flushleft}
    \messagebubble{#2}
    \\ % newline after bubble
    \timestampleft{#1}
    \adjustvspace
  \end{flushleft}
}

\newcommand{\messagebubbleright}[2]{

  \begin{flushright}
    \messagebubble{#2}
    \\ % newline after bubble
    \timestampright{#1}
    \adjustvspace
  \end{flushright}

}

\newcommand{\messagebubble}[1]{
  \ovalbox{
    \pbox{\messagebubblewidth}{
      \textwidth1cm
      #1
    }
  }
}

\newcommand{\messagebubblewidth}{
  0.60\textwidth
}

\newcommand{\adjustvspace}{
  \vspace{-0.6cm}
}

\newcommand{\timestampright}[1]{
  \vspace{2pt}
  \timestamp{#1} % content of timestamp
  \hspace{1pt}
}

\newcommand{\timestampleft}[1]{
  \vspace{2pt}
  \hspace{1pt}
  \timestamp{#1} % content of timestamp
}

\newcommand{\timestamp}[1]{
  {\footnotesize \textit{#1}} % italic and small
}
