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

Pinned Guild Messages #348

Closed
Elderly-Emre opened this issue Feb 5, 2022 · 50 comments
Closed

Pinned Guild Messages #348

Elderly-Emre opened this issue Feb 5, 2022 · 50 comments

Comments

@Elderly-Emre
Copy link
Contributor

i have an idea. we need to pinned guild messages. sometimes we need a lot. Instead of sharing a message over and over at different times, something like this is very useful.

@FrutyX
Copy link
Collaborator

FrutyX commented Feb 5, 2022

But doesn't Vox Logus (Bathouse) exists for such things?

@GreatApo
Copy link
Member

GreatApo commented Feb 5, 2022

But doesn't Vox Logus (Bathouse) exists for such things?

True...

@Elderly-Emre
Copy link
Contributor Author

most people don't use the (vox logus) hamam.
You know this too.

@FrutyX
Copy link
Collaborator

FrutyX commented Feb 6, 2022

Nonsense, on every server I've played, all useful info was always in Vox Logus for all to see.

If your players are not using it, it's their fault and own mistake. Now to the feature request, I see a different option, one more realistic - add a "Share" button to Vox Logus messages, when you click on it, it will copy the Vox Logus message and send it as a guild message, so you can easily share any messages directly from Vox Logus.

The original idea with "pinned messages" isn't that much possible, because you have to store the message somewhere, and you can't use your browser memory because everyone has to see it (which is the main idea here), it would be only possible with a remote server (with stored messages) and you don't want that, because who will pay for the servers (also it's too much work for such a small feature) ?

@GramThanos
Copy link
Member

We can mix them maybe. We can add a feature to check Vox Logus (every 1 or 2 hours) for a special message and pin it at the top of the messages (anyone with write access to Vox Logus would be able to pin a message.

But keep in mind that this addon servers the players, not the guilds, so it cant enforce features related to guilds. Additionally, this would most probably be disabled by default as most guilds would not use it (maybe we can propose to the user to enable it if such a message is found when he visits the Vix Logus).

Still, this maybe a bit problematic.

@Elderly-Emre
Copy link
Contributor Author

When a new member comes to a guild, he introduces himself on the vox logus. but after that vox logus never looks again. same goes for me.
GramThanos' idea looks very good

GreatApo added a commit that referenced this issue Jun 26, 2022
Further style changes are needed when messages style improvements are not enabled
@GreatApo GreatApo self-assigned this Jun 26, 2022
@GreatApo
Copy link
Member

GreatApo commented Jun 26, 2022

Go to guild bath room 1, write a post, click the pin button and then submit it (you need to have authorization to delete any messages and post for the button to show). Based on your refresh interval (in GCA global options, the interval that used to be only for guild applications) the message will show up at the top of the messages.

Caution: The algorithm searches for a message with "[⚲]" at the start, so every player with write access can bypass the disabled button.

@SleepingShadow-bit
Copy link
Collaborator

Really Nice =)

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

Eh, a button you say? Maybe I am doing something wrong, no console errors.

huh

@DinoDevs DinoDevs deleted a comment from GramThanos Jun 26, 2022
@GreatApo
Copy link
Member

GreatApo commented Jun 26, 2022

Eh, a button you say? Maybe I am doing something wrong, no console errors.

That should have worked. The authorization is checking if the messages are more than the delete message links.

// Check if admin by checking if you can delete all messages
let numberOfMessages = document.getElementById('content').getElementsByTagName('tr').length/4;
let links = document.getElementById('content').getElementsByTagName('a');
let numberOfDeleteLinks = 0;
for (var i=0; i<links.length; i++) {
	let href = links[i].getAttribute('href');
	if ( href.match('&den=') )
		numberOfDeleteLinks++;
}
if(numberOfMessages > numberOfDeleteLinks){
	console.log('[GCA] Not authorized to pin messages');
	return;
}

Can you test in your console what number the document.getElementById('content').getElementsByTagName('tr').length/4 gives you compared to the delete links found (code in the loop)?

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

It always give me the right number of delete buttons that exist, if I understand you right.

@SleepingShadow-bit
Copy link
Collaborator

SleepingShadow-bit commented Jun 26, 2022

What u mean about "you need to have delete all messages..."
I don't delete message and i see the pin and works.

IMG_20220626_171146

Online with kiwi browser mobile

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

I got confused about that part too :D.

GreatApo added a commit that referenced this issue Jun 26, 2022
- Style fixes (now works when improved messages style off)
- Console log message if no authorization to pin a message
- Pinned messages will not appear if no other guild messages are shown (as a way to recognize if the messages folder is irrelevant to guild messages)
@GreatApo
Copy link
Member

Sorry, I rephrased that: if you can post and you can delete any post, then the button will appear
I am basically trying to recognize if the player is an "admin" or has more rights than a normal member (delete posts)

The last commit post on the console if you have no rights

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

You sure it will work for me where there are no other messages from other players, only from me, so GCA isn't sure about it?

That's probably why it does not show, solo guild, so it's not a bug + you probably don't need to pin messages in a one man guild.

I currently don't have an another account to test this...

@GreatApo
Copy link
Member

You sure it will work for me where there are no other messages from other players, only from me, so GCA isn't sure about it?

That's probably why it does not show, solo guild, so it's not a bug + you probably don't need to pin messages in a one man guild.

It should have been working. Do you get the no authorization in the console.log? Send me the page source code...

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

Nothing in the console, I've checked the source code before, there is nothing about the button, it does not exist.

@GreatApo
Copy link
Member

Nothing in the console, I've checked the source code before, there is nothing about the button, it does not exist.

I have pushed a commit. If there is nothing, it's something else

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

Yes, I always update the folder to the latest commit. I am not aware why it's not showing tho.

@GreatApo
Copy link
Member

Yes, I always update the folder to the latest commit. I am not aware why it's not showing tho.

Email me the html source code

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

I have a better idea, have you tried using Google Chrome (v103)?

@SleepingShadow-bit
Copy link
Collaborator

SleepingShadow-bit commented Jun 26, 2022

I have now deleted the Badehaus message. My countdown is at 2 minutes. Now after 15 minutes the message is still visible in the guild mail page!

Edit: Umlaut don't show right. My word "löschen"
IMG_20220626_220057

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

By the way, if you write normally, it's fine, but if you write it like an idiot, it's not complete, but perhaps if someone wanted to show something like a bulleted list of something, it will not work.

Nothing serious, but if you want to address it...

Watch:

msg
msg2

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

Some parts of the extension are updated as soon as you change its file (e.g. each page's script). Other parts need (e.g. script loader) are reloaded when you reload the extension (restart browser).

Your browser may cached a script. Its always good to clear the cache after loading new code. Furthermore, you can clear temporary data form the addon's settings (this may reset some timers).

That's like the most generic answer that some support staff would write to you, did you even read what I wrote? I did restart the browser, I did cleared GCA&Gladiatus cookies, cache and data, that's why it is a miracle to me. And yes, I even tried it via GCA settings.

But let's just forget it, I am just glad it's solved.

@GramThanos
Copy link
Member

Yes, I read your message. Sorry for not specifing it, my reply was more some general info and guessing on what may affect the behavior. I am as confused as you.

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 26, 2022

That's fine @GramThanos, don't get me wrong - thank you for trying to help anyway, not sure what went wrong, but it's gone now.

@GreatApo
Copy link
Member

Thanos is right. I completely forgot that the baths.js was a new file and you need to refresh the addon so that is is recognized and it is loaded.

Well spot Thanos.

@SleepingShadow-bit
Copy link
Collaborator

If I missed it then sorry....

Is it possible to post a text with a paragraph as a pinned message?
Screenshot_19

Screenshot_18

@GreatApo
Copy link
Member

If I missed it then sorry....

Is it possible to post a text with a paragraph as a pinned message?

Fixed

@SleepingShadow-bit
Copy link
Collaborator

Thanks a lot. It works very well

@SleepingShadow-bit
Copy link
Collaborator

I would like to pass on a thank you from my guild members here. The feature is very well received!

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 29, 2022

Apo The Great 💪

@Elderly-Emre
Copy link
Contributor Author

Elderly-Emre commented Jun 30, 2022

even though I deleted the message from the bathouse, still looks on message panel.
I've been waiting for 2-3 hours,
image

@SleepingShadow-bit
Copy link
Collaborator

Had the problem too and got it fixed (#348 (comment) + #348 (comment)) .

Do you have the current version? Also doesn't it work with 1 minute (for testing)?
Clear your gca addon cache and try again

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 30, 2022

I've checked it too and it has been fixed

Download it again with the latest commit, set it to 1 min for testing purposes and see if it's okay, if that does not work you can try deleting your gca data like Shadow said, as a last resort you can delete the extension from your browser completely and add it back again.

@Elderly-Emre
Copy link
Contributor Author

uninstalling and reinstalling solved my problem

@FrutyX
Copy link
Collaborator

FrutyX commented Jun 30, 2022

Awesome and interesting... I had to do the same in the end to make this work properly.

@SleepingShadow-bit
Copy link
Collaborator

Do you think it is possible to directly link a pinned hyperlink. As in the guild mails (see screen)

IMG_20220705_212855

@FrutyX
Copy link
Collaborator

FrutyX commented Jul 5, 2022

Also, the pin/unpin button is only showing when creating a new message, but it's not showing when you are editing already existing message, so for example, if you want to remove your current pin, but not the message, you have to delete the symbol manually.

But maybe it's on purpose, I don't know.

@SleepingShadow-bit
Copy link
Collaborator

SleepingShadow-bit commented Jul 5, 2022

I think its ok. Because the pin/unpin button is only there to automatically insert the symbol [⚲]. If I edit the amount, I remove the symbol [⚲] and the pin is gone. And I can manually add the pin again at any time. Or do I misunderstand you

Edit:
Now I understand you.
It says Pin = works and Unpin = doesn't work automatically via the icon

If I edit a pinned post, the unpin icon should be visible

@FrutyX
Copy link
Collaborator

FrutyX commented Jul 5, 2022

I see Apo added it. He scripted it from scratch and made it work in messages, thus I did not seen a reason why it should not be enabled while editing too.

@GreatApo
Copy link
Member

GreatApo commented Jul 5, 2022

Do you think it is possible to directly link a pinned hyperlink. As in the guild mails (see screen)

image

@FrutyX FrutyX added this to the v4.3.6 milestone Jul 23, 2022
@SleepingShadow-bit
Copy link
Collaborator

Would it be possible to add a paragraph after the nickname for the sake of clarity?

IMG_20220812_133047

@FrutyX
Copy link
Collaborator

FrutyX commented Sep 13, 2022

Implemented in v4.3.6, closing, re-open if needed.

@FrutyX FrutyX closed this as completed Sep 13, 2022
@SleepingShadow-bit
Copy link
Collaborator

Does anyone know if my last comment was still implemented?

@GramThanos
Copy link
Member

I don't think so. We have to move it to a new issue.

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

No branches or pull requests

5 participants