package net.cobem.grizzly.communication.composers.messenger;

import net.cobem.grizzly.communication.EventResponse;
import net.cobem.grizzly.communication.HeaderLibrary;
import net.cobem.grizzly.habbohotel.users.User;
import net.cobem.grizzly.habbohotel.users.messenger.MessengerHandler;

public class SendPendingFriendRequestsComposer {
    public static EventResponse compose(MessengerHandler Handler) {
        EventResponse Message = new EventResponse();

        Message.Initialize(HeaderLibrary.InitializePendingFriendRequestsEvent);
        Message.addInt(Handler.GrabRequests().size());
        Message.addInt(Handler.GrabRequests().size());

        for (User mUser : Handler.GrabRequests().values()) {
            Message.addInt(mUser.getID());
            Message.addString(mUser.getUsername());
            Message.addString(mUser.getLook());
        }

        return Message;
    }
}
