Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.text.me = main.text.them? #1441

Closed
aba-hollerer opened this issue Nov 24, 2020 · 14 comments
Closed

main.text.me = main.text.them? #1441

aba-hollerer opened this issue Nov 24, 2020 · 14 comments
Assignees
Labels
Milestone

Comments

@aba-hollerer
Copy link

Expected Behavior

I'd expect that setting main.text.me different to main.text.them in a theme would result in two different colors.

Current Behavior

I am setting main.text.me=white and main.text.them=blue but I always get blue.

Possible Solution

Steps to Reproduce (for bugs)

  1. emerge -aq profanity
  2. set colors in theme file like "main.text.me=white" and "main.text.them=blue"
  3. /theme load [mycolortheme]
  4. in chats all text will be blue

Context

It's not critical or anything I just thought somebody should know.

Environment

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Disabled
PGP support: Disabled
OMEMO support: Disabled
C plugins: Enabled
Python plugins: Enabled (3.7.9)
GTK icons: Enabled

  • If you could not yet build profanity, mention the revision you try to build from
  • Operating System/Distribution
    Gentoo amd64
  • glib version
    ldd (Gentoo 2.32-r2 p2) 2.32
@jubalh jubalh added this to the 0.10.0 milestone Nov 24, 2020
@jubalh
Copy link
Member

jubalh commented Dec 8, 2020

Must be a problem with your theme.
You can check your colors with /theme properties.

showprof1

main.text=white
main.text.me=cyan
main.text.them=red   

@jubalh jubalh added the invalid label Dec 8, 2020
@jubalh jubalh closed this as completed Dec 8, 2020
@aba-hollerer
Copy link
Author

My problem was that /theme properties was correct!
This seems to fix the issue for me.

index 687af3b2..663b49b5 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1215,7 +1215,7 @@ win_print_outgoing(ProfWin* window, const char* show_char, const char* const id,
         _win_correct(window, message, id, replace_id, myjid);
     } else {
         //TODO my jid
-        _win_printf(window, show_char, 0, timestamp, 0, THEME_TEXT_THEM, "me", myjid, id, "%s", message);
+        _win_printf(window, show_char, 0, timestamp, 0, THEME_TEXT_ME, "me", myjid, id, "%s", message);
     }

     inp_nonblocking(TRUE);

@jubalh jubalh removed the invalid label Dec 9, 2020
@jubalh jubalh reopened this Dec 9, 2020
@jubalh
Copy link
Member

jubalh commented Dec 10, 2020

My problem was that /theme properties was correct!

What do you mean?

@aba-hollerer
Copy link
Author

I mean that /theme properties correctly resolved the colors fot main.text.me and main.text.them.
However all text in the chat appeared as main.text.them.

@jubalh
Copy link
Member

jubalh commented Dec 10, 2020

@aba-hollerer but in my screenshot it looks correct, doesn't it?
Can you provide your theme file and/or screenshot?

@aba-hollerer
Copy link
Author

I used the following testing theme:

[colours]
main.text=white
main.text.me=cyan
main.text.them=red

This resolved as follows:
2020-12-11-075353_366x226_scrot

But:
2020-12-11-075425_158x37_scrot

However I don't really see the point in all of this since I already posted the patch...

@wstrm
Copy link
Contributor

wstrm commented Dec 11, 2020

@aba-hollerer are you sending from two different instances here?

Then, I'm able to reproduce it like (in a MUC):
2020-12-11-083607_380x93_scrot

(@jubalh is this expected?)

However I don't really see the point in all of this since I already posted the patch...

I think we're just trying to understand what this solves :)

@aba-hollerer
Copy link
Author

@wstrm: No this was on the same instance.
With the patch applied:
2020-12-11-091036_264x41_scrot

@jubalh
Copy link
Member

jubalh commented Dec 11, 2020

However I don't really see the point in all of this since I already posted the patch...

Your patch looks right to me on first glance. The point is to verify the root cause of this. Is it a misunderstanding? Is it an error that you found and solved? Is it another error and your solution is only covering it up?

As stated above we cannot reproduce this issue on our side (both @wstrm and me), which is suspicious don't you agree?

Like you saw in the code there are many cases. I also think that it is possible that you send with another client/instance and thus carbons are used.

@aba-hollerer
Copy link
Author

So I dug a little further in src/ui/window.c. The problem seems not to be present for MUC:
In win_print_outgoing_muc_msg:

_win_printf(window, show_char, 0, timestamp, 0, THEME_TEXT_ME, me, me, id, "%s", message);

But in win_print_outging:

_win_printf(window, show_char, 0, timestamp, 0, THEME_TEXT_THEM, "me", myjid, id, "%s", message)

@jubalh
Copy link
Member

jubalh commented Dec 11, 2020

I still don't see why I couldn't reproduce it.

But I think you are right. The mistake seems to be introduced in b6b7dd5

@jubalh
Copy link
Member

jubalh commented Dec 11, 2020

I have /receipts set to on. Thus win_print_outgoing() isn't used.

@jubalh jubalh self-assigned this Dec 11, 2020
@jubalh jubalh closed this as completed in d5415b9 Dec 11, 2020
@jubalh
Copy link
Member

jubalh commented Dec 11, 2020

Thanks for your investigations @aba-hollerer !

@aba-hollerer
Copy link
Author

Thank you for maintaining such an awesome piece of software:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants