//
//  ModeratorMessageRequest.m
//  SFS2X
//
//  Original development by Infosfer Game Technologies Ltd. | http://www.infosfer.com.
//
//  Maintained and developed by A51 Integrated.
//  Copyright 2012 A51 Integrated | http://a51integrated.com. All rights reserved.
//

#import "ModeratorMessageRequest.h"
#import "MessageRecipientMode.h"
#import "GenericMessageType.h"

@implementation ModeratorMessageRequest


-(id)initWithMessage:(NSString *)message recipientMode:(MessageRecipientMode *)recipientMode params:(id <ISFSObject>)params {
	
	if ((self = [super init])) {
		if (recipientMode == nil) {
			@throw [[NSException alloc] initWithName:@"ArgumentError" reason:@"RecipientMode cannot be null!" userInfo:nil];
		}
		
		_type = GenericMessageType_MODERATOR_MSG;
		self.message = message;
		self.params = params;
		self.recipient = recipientMode.target;
		_sendMode = recipientMode.mode;
	}
	return self;
}

+(id)requestWithMessage:(NSString *)message recipientMode:(MessageRecipientMode *)recipientMode params:(id <ISFSObject>)params {
	ModeratorMessageRequest *req = [[ModeratorMessageRequest alloc] initWithMessage:message recipientMode:recipientMode params:params];
	return req;
}


@end
