Closed MrPowerGamerBR closed 7 years ago
This should be fixed now! 😃 Sorry it took so long.
Can you test with the latest version (1.0.15) and tell me if it works?
@Delthas so you aren't dead, huh? 😋
Will test this ASAP. 😉
@Delthas doesn't seem to work...
The user is logged in successfully, but then this happens:
Exception in thread "Skype-Receiver-Thread" java.lang.IllegalArgumentException
at fr.delthas.skype.NotifConnector.parseEntity(NotifConnector.java:707)
at fr.delthas.skype.NotifConnector.updateThread(NotifConnector.java:667)
at fr.delthas.skype.NotifConnector.processPacket(NotifConnector.java:206)
at fr.delthas.skype.NotifConnector.lambda$connect$2(NotifConnector.java:499)
at java.lang.Thread.run(Thread.java:745)
Code
package com.mrpowergamerbr.sparklywhistlerbot;
import java.io.IOException;
import com.mrpowergamerbr.sparklywhistlerbot.utils.SuperSecret;
import fr.delthas.skype.Skype;
import fr.delthas.skype.User;
public class SkypeWhistler {
public static void main(String[] args) {
Skype skype = new Skype(SuperSecret.username, SuperSecret.password);
try {
// If you want to report a bug, enable logging
// Skype.setDebug(path);
skype.connect(); // Will block until we're connected
} catch (IOException | InterruptedException e) {
System.err.println("An error occured while connecting...");
e.printStackTrace();
}
// Set the error callback (will be called if any exception is thrown)
// When it is called, you'll be automatically disconnected
skype.setErrorListener(Exception::printStackTrace);
// We're connected and ready to go
// Say hello to all your contacts
for (User user : skype.getContacts()) {
System.out.println(user.getDisplayName());
}
System.out.println("Done!");
}
}
("Done!" is never printed, neither the user names)
@Delthas debugged a bit more, it is random when that exception happens, sometimes it does trigger an exception and nothing is printed, sometimes it does print the contact names and then throws an exception.
Both times the user is successfully logged in into Skype.
@Delthas after MORE debugging, I edited JavaSkype to remove that exception and then added a "if (user != null) {" check in the "updateUser" method, now JavaSkype seems to work.
EDIT: Seems to work after my edit, I created a bot to relay Skype messages to Discord (and soon vice-versa)
Could you enable debugging and send me the debug files please? (before and after your fix) @MrPowerGamerBR 😃
It seems there are phone numbers (accounts that are just phone numbers, not real Skype accounts) to some of the groups you are in. I think ignoring these contacts is the right thing to do for this library. I'll add a fix for this.
I have added the fix in 1.0.16, please try it and tell me if it works! 😄
Nice! I would test it but my PC died :(
Oh too bad. But I guess this will give me some time to fix all the other issues haha
@Delthas fixed my PC (power supply malfunction due to heat + broken cooler)
...and it is working! 😄