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

Can't disable elcord-mode #4

Closed
ShadowMitia opened this issue Apr 9, 2018 · 14 comments
Closed

Can't disable elcord-mode #4

ShadowMitia opened this issue Apr 9, 2018 · 14 comments

Comments

@ShadowMitia
Copy link

I can't seem to be able to disable elcord, I tried calling elcord-mode but it still sends updadtes to the Rich Presence, however long I wait. Calling it several times does not seem to help either.

Extract from my *messages*:

Starting Emacs daemon.
When done with this frame, type C-x 5 0
Configuring package helm...done (0.237s)
Elcord mode enabled
elcord: attempting reconnect..
elcord: connecting...
elcord: connected. starting updates
Elcord mode disabled
elcord: disconnected
elcord: attempting reconnect..
elcord: connecting...
elcord: connected. starting updates
Elcord mode enabled
elcord: attempting reconnect..
elcord: connecting...
Elcord mode disabled
elcord: disconnected
elcord: attempting reconnect..
elcord: connecting...
elcord: connected. starting updates

I'm using Fedora 27 and Emacs 25.3.1

@Mstrodl
Copy link
Owner

Mstrodl commented Apr 9, 2018

@ShadowMitia Hm, looks like we forgot to disable the reconnection code once the mode is disabled

@Mstrodl
Copy link
Owner

Mstrodl commented Apr 11, 2018

@ShadowMitia This should be fixed in the latest commit (0cef4ca)!

@Mstrodl Mstrodl closed this as completed Apr 11, 2018
@ShadowMitia
Copy link
Author

It disconnects fine now, thanks!

But once disconnected it still shows the last update in the Rich Presence in Discord. And it doesn't seem to be going away even after waiting for a while... On the plus side it doesn't update when changing buffers at all!

The only way to make the Rich Presence go back to normal right now is by either quitting emacs or stopping the daemon if running with it.

@Mstrodl
Copy link
Owner

Mstrodl commented Apr 13, 2018

Hm, something tells me that might be more on Discord's end than anything... See if you can take a screenshot of the console in the inspector (ctrl-shift-i) and mark off with arrows or something when you did certain things... :/

@Mstrodl Mstrodl reopened this Apr 13, 2018
@ShadowMitia
Copy link
Author

Sorry if this is giving you a headache^^

elcord

Everything looks fine, except that last line with 'RunningGameStore' that only appears after I quit emacs :/
This happens wether I run emacs as a daemon or not.

Let me know if I can give you more information! Wish I could help more, but I don't know too much about elisp yet...

@Mstrodl
Copy link
Owner

Mstrodl commented Apr 13, 2018

Hm, it looks like it might just be Discord tracking the pid we send in the SET_ACTIVITY packet.... I don't think we can actually do anything about that aside from spawning a process that does nothing, using its pid, and killing it after disconnecting

@ShadowMitia
Copy link
Author

Yeah, sounds like Discord Rich Presence was not designed for this...

But if it tracks the PID I understand it not working when in daemon mode, but it does the same when emacs is run in standalone. Shouldn't it detect emacs not running anymore then? Maybe I did something, I should probably double check....

@Mstrodl
Copy link
Owner

Mstrodl commented Apr 15, 2018

@ShadowMitia Huh? I'm not sure you understand what I'm saying... I'm trying to say that the mode being disabled currently acts funny because Discord doesn't stop recognizing emacs as being played until the pid we send it is killed, even if we completely disconnect it from Discord's RPC server

@ShadowMitia
Copy link
Author

Right, yeah my bad.... Silly remark...

You said to use a dummy process for its PID earlier, but couldn't you have elcord run in that process directly instead? Then you wouldn't have a dummy process^^

@Mstrodl
Copy link
Owner

Mstrodl commented Apr 15, 2018

@ShadowMitia Yeah, but that'd require us to either call a headless emacs and somehow get our information back and forth which imo seems like a kludgy solution... My thought was running something like cat and then we'd be able to kill it at will. Again, just a thought

@ShadowMitia
Copy link
Author

Keeping in mind that I'm very new at elisp, and bad at processes, but couldn't having an asynchronous process solve everything?
You would still have the mode active on the main emacs thread, just have the part hooked up to the RPC in a subprocess. But I'm guessing it shares the same PID.

In any case, I think I've made this issue diverge sufficiently from its original purpose^^ You should probably close this. I'm sure a solution will turn up someday^^

@Mstrodl
Copy link
Owner

Mstrodl commented Mar 11, 2021

@ShadowMitia I finally figured out how to do this! After checking the source, we can actually send null as the activity and it will simply clear itself!

@Mstrodl Mstrodl closed this as completed Mar 11, 2021
@ShadowMitia
Copy link
Author

@Mstrodl Congrats! Thanks for working on this issue! I hope it didn't give you any sleepless nights 😁

@Mstrodl
Copy link
Owner

Mstrodl commented Mar 11, 2021

@ShadowMitia No worries, it's more that I stumbled upon it :P

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

No branches or pull requests

2 participants