aboutsummaryrefslogtreecommitdiff
path: root/ui/messages/imagemessage.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/messages/imagemessage.go')
-rw-r--r--ui/messages/imagemessage.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/messages/imagemessage.go b/ui/messages/imagemessage.go
index 3f50193..671148b 100644
--- a/ui/messages/imagemessage.go
+++ b/ui/messages/imagemessage.go
@@ -29,6 +29,7 @@ import (
"maunium.net/go/gomuks/lib/ansimage"
"maunium.net/go/gomuks/ui/messages/tstring"
"maunium.net/go/tcell"
+ "maunium.net/go/gomuks/config"
)
func init() {
@@ -92,13 +93,13 @@ func (msg *ImageMessage) Path() string {
// CalculateBuffer generates the internal buffer for this message that consists
// of the text of this message split into lines at most as wide as the width
// parameter.
-func (msg *ImageMessage) CalculateBuffer(bare bool, width int) {
+func (msg *ImageMessage) CalculateBuffer(prefs config.UserPreferences, width int) {
if width < 2 {
return
}
- if bare {
- msg.calculateBufferWithText(bare, tstring.NewTString(msg.PlainText()), width)
+ if prefs.BareMessageView || prefs.DisableImages {
+ msg.calculateBufferWithText(prefs, tstring.NewTString(msg.PlainText()), width)
return
}
@@ -111,10 +112,10 @@ func (msg *ImageMessage) CalculateBuffer(bare bool, width int) {
msg.buffer = image.Render()
msg.prevBufferWidth = width
- msg.prevBareMode = false
+ msg.prevPrefs = prefs
}
// RecalculateBuffer calculates the buffer again with the previously provided width.
func (msg *ImageMessage) RecalculateBuffer() {
- msg.CalculateBuffer(msg.prevBareMode, msg.prevBufferWidth)
+ msg.CalculateBuffer(msg.prevPrefs, msg.prevBufferWidth)
}