<commit_before>#include "message_row.h"
#include <gdkmm/pixbufloader.h>
#include <glibmm/datetime.h>
#include <gtkmm/stock.h>
#include <libsoup/soup-uri.h>
#include <iostream>
#include "attachments_view.h"

MessageRow::MessageRow(const api_client &api_client, icon_loader &icon_loader,
                       emoji_loader &emoji_loader,
                       const users_store &users_store,
                       const channels_store &channels_store,
                       const Json::Value &payload)
    : hbox_(Gtk::ORIENTATION_HORIZONTAL),
      vbox_(Gtk::ORIENTATION_VERTICAL),
      info_hbox_(Gtk::ORIENTATION_HORIZONTAL),
      user_image_(Gtk::Stock::MISSING_IMAGE,
                  Gtk::IconSize(Gtk::ICON_SIZE_BUTTON)),
      user_label_("", Gtk::ALIGN_START, Gtk::ALIGN_CENTER),
      timestamp_label_("", Gtk::ALIGN_END, Gtk::ALIGN_CENTER),
      message_text_view_(users_store, channels_store, emoji_loader),
      file_image_(Gtk::Stock::MISSING_IMAGE,
                  Gtk::IconSize(Gtk::ICON_SIZE_BUTTON)),

      api_client_(api_client),
      icon_loader_(icon_loader),
      users_store_(users_store),
      channels_store_(channels_store) {
  add(hbox_);

  hbox_.pack_start(user_image_, Gtk::PACK_SHRINK);
  hbox_.pack_end(vbox_);

  vbox_.pack_start(info_hbox_, Gtk::PACK_SHRINK);

  info_hbox_.pack_start(user_label_, Gtk::PACK_SHRINK);
  info_hbox_.pack_end(timestamp_label_, Gtk::PACK_SHRINK);

  Pango::AttrList attrs;
  Pango::Attribute weight =
      Pango::Attribute::create_attr_weight(Pango::WEIGHT_BOLD);
  attrs.insert(weight);
  user_label_.set_attributes(attrs);

  const double ts = std::stof(payload["ts"].asString());
  const Glib::DateTime timestamp = Glib::DateTime::create_now_local(gint64(ts));
  timestamp_label_.set_text(timestamp.format("%F %R"));

  const Json::Value subtype_value = payload["subtype"];
  std::string text = payload["text"].asString();<commit_msg>Fix user icon alignment<commit_after>#include "message_row.h"
#include <gdkmm/pixbufloader.h>
#include <glibmm/datetime.h>
#include <gtkmm/stock.h>
#include <libsoup/soup-uri.h>
#include <iostream>
#include "attachments_view.h"

MessageRow::MessageRow(const api_client &api_client, icon_loader &icon_loader,
                       emoji_loader &emoji_loader,
                       const users_store &users_store,
                       const channels_store &channels_store,
                       const Json::Value &payload)
    : hbox_(Gtk::ORIENTATION_HORIZONTAL),
      vbox_(Gtk::ORIENTATION_VERTICAL),
      info_hbox_(Gtk::ORIENTATION_HORIZONTAL),
      user_image_(Gtk::Stock::MISSING_IMAGE,
                  Gtk::IconSize(Gtk::ICON_SIZE_BUTTON)),
      user_label_("", Gtk::ALIGN_START, Gtk::ALIGN_CENTER),
      timestamp_label_("", Gtk::ALIGN_END, Gtk::ALIGN_CENTER),
      message_text_view_(users_store, channels_store, emoji_loader),
      file_image_(Gtk::Stock::MISSING_IMAGE,
                  Gtk::IconSize(Gtk::ICON_SIZE_BUTTON)),

      api_client_(api_client),
      icon_loader_(icon_loader),
      users_store_(users_store),
      channels_store_(channels_store) {
  add(hbox_);

  hbox_.pack_start(user_image_, Gtk::PACK_SHRINK);
  hbox_.pack_end(vbox_);
  user_image_.set_alignment(Gtk::ALIGN_CENTER, Gtk::ALIGN_START);

  vbox_.pack_start(info_hbox_, Gtk::PACK_SHRINK);

  info_hbox_.pack_start(user_label_, Gtk::PACK_SHRINK);
  info_hbox_.pack_end(timestamp_label_, Gtk::PACK_SHRINK);

  Pango::AttrList attrs;
  Pango::Attribute weight =
      Pango::Attribute::create_attr_weight(Pango::WEIGHT_BOLD);
  attrs.insert(weight);
  user_label_.set_attributes(attrs);

  const double ts = std::stof(payload["ts"].asString());
  const Glib::DateTime timestamp = Glib::DateTime::create_now_local(gint64(ts));
  timestamp_label_.set_text(timestamp.format("%F %R"));

  const Json::Value subtype_value = payload["subtype"];
  std::string text = payload["text"].asString();
{'fraction_non_alphanumeric': 0.12922210849539406, 'fraction_numerical': 0.0010235414534288639, 'mean_word_length': 4.451882845188284, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2313031', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1328, 'n_words': 172}