tasfe / iqq

Automatically exported from code.google.com/p/iqq
0 stars 0 forks source link

分组中用户在线数计算有Bug #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
当一个好友,在忙和在线之间切换QQ状态时,由于都是“上线��
�,分组所在用户在线数会一直累加,甚至在线人数超过了分�
��人数,明显不符合事实

应该判断是不是同一个用户在做“忙碌”,“Q我吧”,“在�
��”等“上线”状态之间切换。如果是就不能累加。

在CategoryService.java

int count = m.getCategory().getOnlineCount();
                    if (m.getStatus() == null || m.getStatus().equals("") || m.getStatus().equals("hidden")
                            || m.getStatus().equals("offline")) {
                        if (count > 0) {
                            --count;
                        } else {
                            count = 0;
                        }
                        m.getCategory().setOnlineCount(count);
                        memberList.remove(i);
                        memberList.add(memberList.size(), m);
                    } else {
                        m.getCategory().setOnlineCount(++count);
                        memberList.remove(i);
                        memberList.add(0, m);
                    }

Original issue reported on code.google.com by www.prac...@gmail.com on 28 Aug 2012 at 7:45

Attachments: