« first day (439 days earlier)      last day (1231 days later) » 
00:00 - 19:0019:00 - 00:00

19:07
Ha! I fixed rene :D cc @OlegValter
// Setting prefix for specific users that are also moderators:
rules.prefix.users.forEach(user => {
    user.profiles.forEach(profile => {
        const { char } = user;
        if (char) addRule(prefixUser(".username.moderator",
                                     rules.prefix.default.moderators+char,
                                     getUserId(profile)));
    });
});
I've been looking at this documentation of the chat API. But I'm not sure there is an easy way to get ROs.
You can get pingable users from the API like this: fetch("https://chat.stackoverflow.com/rooms/pingable/214345/").then(res => res.json()).then(console.log)
It is similar to ROOM_USERS_BY_ID but it doesn't actually mark if users are room owners or mods.
Ohh.. don't let people see you use fetch().then().then() in here ;)
It's possible to ask for user info for a specific room but I can't seem to get the request for that correct. I keep getting an error.
You can also get the room description but it doesn't include owners. Perhaps scraping the HTML info page is the most straight forward way.
That's what I suggested, but then Anonymous found the global variable.
It also should be possible to get the room transcript programmatically but not sure how.
Annoyingly, I cannot seem to find a SE chat API by SE. A few people wrote something themselves, I assume by reverse engineering the calls that the browser makes.
19:16
@Scratte achoo!
oh, there is another global variable to add to our package that reverse-engineers SE's types! :)
@VLAZ "Programming sucks" comes to mind again.
@VLAZ yeah, last time I checked, there was no chat API. Only some packages for bots + some utilities as you mentioned
23
Q: Will the API support the chat system?

JoshHaving read through come of the questions on here it's my understanding that v 1.0 of the API is for read-only access to real-time data, pretty much what's available in the data dump. Write support is planned for version 2.0. My question is, will version 2.0, or some future version after that, ha...

^ just for the reference in case we live long enough to see this added
@Scratte you would probably want to move { chat } = user from inner forEach, there is no need for the overhead :)
I have overhead? :P
    // Setting prefix for specific users that are also moderators:
    rules.prefix.users.forEach(user => {
         const { char } = user;

        const rule = rules.prefix.default.moderators+char;

         if(!char) return;

        user.profiles.forEach(profile => {
           addRule(prefixUser(".username.moderator", rule, getUserId(profile)));
        });
    });
Thanks. I just did that :)
19:25
@Scratte also, since char never changes, why check for if(char) on every inner iteration? :) see above
Why set the rule if there is no char? :)
@Scratte that was also my question :) The chat is just too clunky. Of course, the ideal way is (well, close to, as we don't even need to deep-access moderators in the outer loop):
const { char } = user;
if(!char) return;
const rule = rules.prefix.default.moderators+char;
Is this micro-optimizing?
Because I'm sure Cody would be very proud.
@Scratte no, that's being very pedantic :)
Jul 24 at 19:26, by Oleg Valter
if anyone's wondering, I am a poor man's version of Cody :)
Heh.. Also, I don't check if rules.prefix.default.moderators exist. I think it's fair to let the entire thing crash if it doesn't
19:29
@Scratte exactly - if moderators don't exist, the whole thing is bound to crash :)
Heh.. good one :)
on an off-note - fun question of the day: what do you think is the time complexity of Array.prototype.find?
@OlegValter At this point, why not destructure the parameter directly?
@VLAZ you mean outside the loop? Yes, that would be even better
// Setting prefix for specific users that are also moderators:
rules.prefix.users.forEach(({ char }) => {
	if(!char) return;

	const rule = rules.prefix.default.moderators+char;

	user.profiles.forEach(profile => {
	   addRule(prefixUser(".username.moderator", rule, getUserId(profile)));
	});
});
Yes, like that.
19:36
Oh!.. Maybe I should let you guys micro-optimize my review script :)
@Scratte oh, don't worry, we will macro-optimize it first :)
^ this is what happens when you say "I'll deal with this later" to yourself :)
@OlegValter That button doesn't do anything when I click it (or show anything in the console). This seems like a bug... — Anonymous 2 hours ago
^ @Anonymous I'll need some more info on that - it's a bit odd
@OlegValter What program is making those nice colours?
@Scratte the Git Graph extension for VS Code :)
Ahh.. I'm using the same one. It just looks more colourful in dark mode, I suppose :)
Jul 20 at 20:45, by Scratte
I think I'm going to have to try Git Graph
@Scratte yes, the contrast is higher :)
19:40
Ha!.. So I made you install an extension to Visual Studio Code?
@OlegValter I'm using GreaseMonkey and Firefox, and the script version I'm using is 0.5.1.
@VLAZ Except.. "Uncaught (in promise) ReferenceError: user is not defined" ;)
@Anonymous hm, let's see what FF has to offer
Oops, I completely missed that user was referenced below.
Then again, you only need the profiles, so you can destructure that, as well.
I did :) Thanks :)
19:50
Coffee made my day solved.
in SOBotics Workshop, 7 mins ago, by sBot
There are currently 1 RO in this room.
Shree (last activity: -83 seconds ago)
Via id got it.
*claps*
*also claps for coffee*
I need to see proof of coffee ;)
@VLAZ If you plan to hang out and make scripts and such, I'd expect the organization is still open for membership :)
Though Oleg runs a tight ship ;)
argh, nice, thank you, Greasemonkey: "An unexpected error occurred"
Heh.. that's expected, no? :D
I have some fixes for the Magicâ„¢ Editor that I need to merge back to the source repo. I forked it...last year.
Ugh.
20:00
@VLAZ Just fix ``` code finance . I remove editor from Tampermonkey when SO apply that change. It's totally break codes. :D
I think I did fix that
Also some other stuff.
I've technically been testing it in the mean time. I wanted to makes sure it works. But I also got lazy and haven't merged it back yet.
@Anonymous repro'd
will take a look
damn FF, it was once the staple of "if you want the most compliant browser"
Ooops, this is my version - I forgot to link the correct branch.
ERrr
downgrade and upgrade again.
20:06
Thanks for fix
I'll try to merge this back over the weekend, so more people can use it.
ohhh 2AM. Need some good nap
o/
Good night!
Stacks global object is missing completely
20:10
@OlegValter Did you check under the couch?
@OlegValter From chat? Or from main?
@VLAZ I think the couch is called unsafeWindow :)
can we all just migrate from Greasemonkey to something more modern? It's giving me a headache right now
My suggestion: scrap GM.
I personally use ViolentMonkey.
@OlegValter It's suppose to be safer and stricter. I would have though you liked it ;)
agreed. Seems like it's caused by GM, @Anonymous. I'll add a guard
20:13
I used to be on-board with GM but I think they went too far into protection. Enough to break thousands of scripts. It's like the IE of script managers but, paradoxically, for the opposite reasons IE was bad.
ugh, done. Will be updating to 0.6.1 shortly
@Scratte from main. I did not expect GM to restrict me to unsafeWindow if I want to use any of the globals. Tampermonkey does not do that. And since I guard against Stacks missing, I failed to notice this
I don't even know what unsafewindow is :(
It's like window but it's unsafe, ha!
More seriously, GM restricts access to some global stuff. Allows you to escape that by using unsafeWindow which is the page's window (AFAIR).
But it gets complex...
20:29
Obviously.. it always does :)
@VLAZ yeah, ugh, I did not expect it to restrict access to globally exposed variables as well given that Tampermonkey does not. It was my assumption that TM and VM are supersets of GM, not divergent. Well, I will know better next time ) v0.6.1 published, explicit support for GM added
It's actually GM that diverged. They used to be equal(-ish) in terms of how code worked. But GM really tightened restrictions around what's allowed or not with one version and at that point userscripts that used to work on all three stopped working on GM.
GM became a massive maintenance pain, since you cannot just write your script and expect it'd work everywhere.
@VLAZ argh, that's a bit infuriating. Well, at least my case is pretty solvable with typeof unsafeWindow !== "undefined" and by always getting Stacks from resulting window. Annoying, but somewhat maintainable.
reminds me of the "do you trust this workspace?" feature
Moreover, GM probably requires something like three times the time spent on it than developing for the other two managers. I've seen a lot of userscript authors just abandoning GM. If it works on it, it works, but they just don't develop their userscripts for it.
Which...is very similar to how IE is treated. If it works, it works but you really don't just focus on it.
yeah. Which is somewhat sad, as IE suffers from being one of the first popular ones - whereas it userscript managers definitely do not need to suffer the same fate... ugh
sorry for the sharp change in topic, but I can't help but wonder if Philippe was hired to keep user distracted from issues with SE by engaging in small-talk every couple of days:
30
Q: Community VP Questions: What's the best of Stack?

PhilippeContinuing with my series of questions to you - I've got one that's a bit lighter this week. We spent last week firing up our magic wand and changing things. This time, let's celebrate what exists. I want to know about your favorite contributions (questions, answers, or comments!). These can be...

20:39
Heh.. it's the chit-chat community manager ;)
no, really, that's starting to get on my nerves:
1. More questions from new Community VP - how'd you get started?
2. Magic wand time - what does your community need? (More questions from the Community VP)
3. Community VP Questions: What's the best of Stack?
for how long can introductions go for Christ's sake?
I think I kind of saw this coming.. trust me, it's going to go on for a while.
If you want to look at something else, I uploaded a new version of the diamond script. When/if you have time to check it out and say it's fine, I'll post it.. I think :)
I have to give them credit, though. It's a good hire. They are doing exactly as the position suggests - "manage" the community, congrats
if you forgive me a minute of bitter rambling :)
@Scratte yeah, a moment
@OlegValter No rush.. I have no deadline for this at all. I've used it for over a year.
Well, we're still out:
4. What's your favorite colour?
5. If you left Stack for a while, what made you come back?
are those predictions?
20:52
Yes.. that's just my squirrel brain giving it a go.
@Scratte I suspect the question will be "What's your favorite color?" then :) Do you expect cultural sensitivity?
lol! Good one :)
re:colouring script - LGTM, but I have one question. Why store URLs and extract ids every time if you don't need the urls? Why not store Ids and, if it ever comes up, construct the URLs from them? It also has a benefit of less maintenance if SE decides to change the links
6. What makes you trust Stack?
@OlegValter To make it easy to put in a user. Just put in the link.
@Scratte optimizing for stray editors? :) Want to get a customization UI, btw? I have a free half an hour to spare while I am at it
20:57
Also, just putting in the userid could be confusing.. then I don't know which profile I added there. Is that id for Makyen for stackexchange or stackoverflow?
@OlegValter What kind? :)
@Scratte I know :) Have 2 fields: id and host :)
I expected people to just add users to it in the config element directly.
@Scratte same as 404 script
Oh.. I see. Yes, that's a good idea.
(I didn't check out that script yet :( )
@Scratte heh, will you accept a humble contributor? :)
21:00
@OlegValter You're welcome to play :)
yay :)
When we're in agreement, I may ask you do make the same change on a public repository :D We need get the Oleg-name out in the world.
I was going to consolidate all the userscripts in the same repository. But I'm waiting until double-beep is back before making changes to the structure of my public one.
ugh, have you tried to run your script on SOCVR? :)
I think I just fixed something, and now the script hangs the whole page on SOCVR
I think you had an error in removeBackDiamond
that was silently swallowed
because getElementsByClassName does not exist on Node, but only exists on document
@OlegValter Yes.. it worked with no issues
@Scratte I just checked :) Yes, I overfixed it
apparently fixing removeBackDiamond sends it into an infinite loop
ah, yes, of course
here is your logic :)
21:16
Huh? :)
1. for every mutation record in mutation callback do:
2. select all elements with class name moderator
3. for each element of 2 get children that are of tag <span>
4. for each child from 3, remove that child
the problem is that step 4 causes a new mutation callback to fire for each removed element :)
But by then there's no child :) So it has to end :)
I could remove them all in one go, I suppose.. and only trigger it once again.
@Scratte the problem is... It does not seem to be :) I am checking why
Sometimes.. the diamond is a child of the span element. Other times it's put directly on the innerHTML.
@OlegValter Oh. I think I even put in logging when I did that.
@Scratte you did, but have you checked it on SOCVR? It does work fine in a smaller room like this one
oh, I know why
sorry, that one's on me
don't worry about it
21:23
There's no moderators in here :D That have left messages.
@Scratte nah, it's me. I need coffee
I forgot that Element interface has getElementsByClassName
I think.. I just messed up my own script :D
@Scratte heh :) Perfect, I've fixed it again, sorry about disturbing you
No.. that's fine :)
I just noticed that rene has a diamond on both ends in the Stack Apps room.
But none of the moderators in SOCVR has that.. only in the front.
In the "Ask a Super User Moderator" room its works as it should too.
But I'm getting 60 of these in the Stack Apps room:
Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure element '<URL>'. This request was automatically upgraded to HTTPS, For more information see <URL>
@Scratte hm, that just looks like mixed content warning when not all assets like images are loaded from an HTTPS URL
21:35
It's a little funny. It's like the script reaches a point where it just can't be bothered to finish the rest of them :D
@Scratte heh :) I'll take a look
I think it's my setup. This happens sometimes when I've left in a tab that I kind of abandoned. Then I'll see just two diamond, no name.. and it's like the script just gave up :D
To be honest I think it needs a heartbeat or something to start up again :)
I swear it was working fine when I uploaded it.
huh :)
I just tried the two easier versions and there's no difference..
maybe something's wrong with the room, not with the script
21:45
The image I posted of rene with a diamon, a flower and just the name was from the same room just a few hours ago.
note that browsers can deprioritize script execution if you unfocus the tab or minimize the window
there is an API for checking if the tab loses and regains focus, though
you can force an update every time tab regains focus
> To be honest I think it needs a heartbeat or something to start up again :)
^ well, it would be exactly like what you said :)
Sure, but these double diamonds I'm seeing now is from a fresh reload.. :)
Hmm.. I think, I found a bug in chat-overcharged.
@Scratte hm, what's the issue?
@Scratte interesting
@Scratte I just learnt that you can do that :) I thought chat input is not a valid drop target
interesting find
22:01
It is. I do it all the time when I message myself in chat :)
will you file it on Stack Apps? It's definitely something that I should look into
@OlegValter Sure.. let me make another screen shot then.
@Scratte yeah, I pretty much know what causes it, but I think I will not be able to start until tomorrow
What's the rush?
@Scratte Yay.. :)
and thanks, now I know you can drag-n-drop messages in chat :)
22:09
RyanM taught me that :)
How do I resize an image in markdown?
@Scratte as far as I recall, you need to switch to HTML
<img src="" width="200" height="400" alt="" />
I tried that when posting the bug.. it just ignored it.
It works fine on GitHub though :)
By the way, I'm pretty sure I got rene's permission to use keep them in my script for the flower :)
give me a moment, should work
@Scratte hm?
You can have every moment you want :)
22:25
in what order you specified the attributes?
@OlegValter Moderators are fine.. when I just list a bunch of them like that and give them colours. But I felt like I would single rene out with the flower. So I asked a long time ago if it was fine for me to publish it.
it is important that width / height go directly after src
@Scratte ah, now I get it :)
I only used width.
I'll submit an edit with status-update :)
You really don't need to rush on any of it. That include the 6K lines script too :)
22:37
Nice edit :)
@Scratte thanks :) What was the issue with how you tried to specify the resized images? As you can see, works fine for me
Did you see it in the preview too?
@Scratte yup
Then I must have messed it up somewhere. The thing I tried didn't show at all, so I just left it with the regular markdown.
@Scratte hm, maybe you forgot to close the tag? <img /> is a self-closing tag
22:52
Maybe.. I don't think so. I just copied it off the internet :D
@Scratte we'll never know then :)
I'll go back to that post and copy what you did every time I need it :)
@Scratte :) You can be sure that <img src="url" width="12345" /> will always work, though
I thought perhaps Stack removed it. Like they do with other tags.
23:11
@Scratte they might :) With the new editor, if you try to enter the image like this and then switch views, it will override your HTML
which made me rage-quit from being an early adopter
I think that once the new editor comes I'll have to use Stack only for chat.
Until someone spends 3 months on a userscript that makes writing posts nice again ;)
I think Cody will hold me up to the promise to redo the editor if they do that :)
You promised Cody to do that?
Maybe.. Cody forgot about it already :)
let's remind them then!
Jun 26 at 9:57, by Oleg Valter
@CodyGray yup, consider it a commitment - after all, I worry I'll stop contributing at all otherwise once it's out
Heh.. but you know Cody isn't reading the transcript now, right? :)
23:27
@Scratte but they will :)
That's very unlikely. I think Cody reads the transcript when they're on day to day. But they don't read it when it's been a week or 3 months :)
^ do you like what you see? :)
needs some love in terms of styling, etc, maybe colour inputs, but is in working state already
That looks very very nice :)
@Scratte want a PR? :)
Sure.. :) But.. I'm going to sleep very soon :(
23:36
@Scratte there's no rush to review :)
Btw.. why is the modal black when chat is white?
@Scratte because I reused the basis of the modal from chat overcharged :) theming will come later
No worries.
The idea with the "name" that I don't use in the functions was the users can also just group people in there. So one could have a group called "friends" and they'd all be blue.
I think it's really very nice that you added a link in chat to the modal :)
Nice :) Thank you :)
23:42
@Scratte thanks :)
@Scratte oh, well, we can expand on that and add actual "groups" :)
if you will like the change, I will drop in the ability to drag the modal once I fix the issue you reported
ok, I fixed the dragover bug
@OlegValter The group is just the name a user gives it :)
That's a lot of code I'll need to work out how works :)
Oh.. I have an idea (since I don't like the SO abbreviation of Stack Overflow). It could use icons :)
@Scratte yes, I had this idea too, but it was a little bit too time-consuming to implement right now, but I can transplant clickable icons helper from ARC rewrite later :)
@Scratte no rush at all, I know it's a lot - I tried to keep the number of additions to a minimum, though
It's fine. I'll probably only take a week :D
I get the impression that once you see something and you like the idea, you just go for it :)
@Scratte I wonder how you got that impression? :)
23:58
It's a squirrel-thing. I can recognize any nut ;)
drag-n-drop issue status-completed on version 1.8.1 cc @Scratte
Ohh nice :)
@Scratte my delivery times are much lower than SE's :)
00:00 - 19:0019:00 - 00:00

« first day (439 days earlier)      last day (1231 days later) »