Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

group.getUsers function always return 0 #40

Open
biopowder opened this issue Dec 19, 2017 · 3 comments
Open

group.getUsers function always return 0 #40

biopowder opened this issue Dec 19, 2017 · 3 comments
Assignees

Comments

@biopowder
Copy link

Hi,

I think code will explain everything.

Skype skype = new Skype("bot", "xxx");
skype.connect();
System.out.println("Bot is connected");
List groups = skype.getGroups();
// I have 2 groups
System.out.println(groups.size());
for (Group group : groups) {
List<Pair<User, Role>> usersWithRoles = group.getUsersWithRoles();
System.out.println(usersWithRoles.size());
List users = group.getUsers();
System.out.println(users.size());
}
System.out.println("Bot is disconnected");

output is:
Bot is connected
2
0
0
0
0
Bot is disconnected

@biopowder
Copy link
Author

Update: getUsers returns 0, only is group topic is not changed, once it is changed, getUsers returns correct value

@delthas
Copy link
Owner

delthas commented Dec 21, 2017

Hello, thanks for the issue.

Please send me the debug logs for an example session of this happening. For example, run the following program:

Skype skype = new Skype("bot", "xxx");
Skype.setDebug(Paths.get("logfile.txt")); // notice the setDebug call to produce a log file
skype.connect();
System.out.println("Bot is connected");
List<Group> groups = skype.getGroups();
// I have 2 groups
System.out.println("count of groups: "+groups.size());
System.out.println("printing the groups user count...");
for (Group group : groups) {
List<Pair<User, Role>> usersWithRoles = group.getUsersWithRoles();
System.out.println(usersWithRoles.size());
List<User> users = group.getUsers();
System.out.println(users.size());
}
System.out.println("changing the groups topic...");
for (Group group : groups) {
group.changeTopic("dummy test topic");
}
System.out.println("printing the new groups user count...");
for (Group group : groups) {
List<Pair<User, Role>> usersWithRoles = group.getUsersWithRoles();
System.out.println(usersWithRoles.size());
List<User> users = group.getUsers();
System.out.println(users.size());
}
System.out.println("Bot is disconnected");

It will produce a logfile.txt file which you can then send me so that I can investigate the issue. Thanks.

@metasonic
Copy link

@delthas
First run result:
Bot is connected
count of groups: 3
printing the groups user count...
4
4
0
0
0
0
changing the groups topic...
printing the new groups user count...
4
4
0
0
0
0
Bot is disconnected
Logs: https://pastebin.com/kFyq9rdx

Seconds run result:
Bot is connected
count of groups: 3
printing the groups user count...
4
4
3
3
3
3
changing the groups topic...
printing the new groups user count...
4
4
3
3
3
3
Bot is disconnected
Logs: https://pastebin.com/vE47HYYC

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

No branches or pull requests

3 participants