+
+static void
+update_branding (ModestMsgViewWindow *self)
+{
+ const gchar *account;
+ const gchar *mailbox;
+ ModestAccountMgr *mgr;
+ ModestProtocol *protocol = NULL;
+ gchar *service_name = NULL;
+ const GdkPixbuf *service_icon = NULL;
+ ModestMsgViewWindowPrivate *priv;
+
+ priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self);
+
+ account = modest_window_get_active_account (MODEST_WINDOW (self));
+ mailbox = modest_window_get_active_mailbox (MODEST_WINDOW (self));
+
+ mgr = modest_runtime_get_account_mgr ();
+
+ if (modest_account_mgr_account_is_multimailbox (mgr, account, &protocol)) {
+ if (MODEST_IS_ACCOUNT_PROTOCOL (protocol)) {
+ service_name = modest_account_protocol_get_service_name (MODEST_ACCOUNT_PROTOCOL (protocol),
+ account, mailbox);
+ service_icon = modest_account_protocol_get_service_icon (MODEST_ACCOUNT_PROTOCOL (protocol),
+ account, mailbox, MODEST_ICON_SIZE_SMALL);
+ }
+ }
+
+ modest_msg_view_set_branding (MODEST_MSG_VIEW (priv->msg_view), service_name, service_icon);
+ g_free (service_name);
+}