Hello --
I am starting out on a software to build a BOT server using the AIM.framework for Mac OS X.
I was able to find two topics showing how to sign on. I am not having much of luck, especially when the simpler example is using bindings (which I want to avoid). The other example is pretty intense.
The documentations on AIM.framework is lacking and I'm happy to contribute.
What I really need at this point is to understand how to log in and send messages. Pretty much what the simpler example is doing; however, I would like samples without any bindings.
Is there anybody who can point me in that direction. Thanks a million in advance.
Chad W. Taylor
AIM Frameworks for Mac (samples)
| Login to post | Page: « < 1 of 1 > » |
| 22 Jul 2009 - 02:08 | 4674 |
| convosandbox | AIM Frameworks for Mac (samples) |
| 22 Jul 2009 - 13:20 | 4675 |
| openaimsupport | AIM Frameworks for Mac (samples) I'm not sure I understand. There are examples for using Cocoa, which implies
using the AIM.framework with bindings to components in Cocoa. The other alternative is the samples under C++ which are console based. I suspect that if you are building a bot, you'd want to just use the C++ samples, such as accbot or if you prefer java you could use accjbot. In either of those cases you do not need to deal with bindings to components in Cocoa. Thanks |
| 22 Jul 2009 - 14:53 | 4677 |
| convosandbox | Quote openaimsupport:
I'm not sure I understand. There are examples for using Cocoa, which implies using the AIM.framework with bindings to components in Cocoa. The other alternative is the samples under C++ which are console based. I suspect that if you are building a bot, you'd want to just use the C++ samples, such as accbot or if you prefer java you could use accjbot. In either of those cases you do not need to deal with bindings to components in Cocoa. Thanks Thank you for your reply. The thing is that the company has requested to use AIM.framework and build a BOT from it. I have reviewed the C++ and Java samples to get some clues/hints and apply it to the Objective C language. I have reviewed the Cocoa examples. There are two of them. The accocsample is a simpler one as it provides a simple connection and sending a message (which is pretty much what I want). The problem is that it uses binding and I want to see similar example to accsample but WITHOUT the bindings. The other example, accocbuddy, is pretty loaded. I'm trying to weed out everything but it's pretty hard to follow something that is loaded. Is there someone out there that has similar non-binding codes as the accocsample? Last edited by convosandbox (22 Jul 2009 - 15:10) |
| 22 Jul 2009 - 15:26 | 4678 |
| convosandbox | I am able to get the BOT connected with the following codes:
AccOcSession* session = [[AccOcSession alloc] init];
[session setDelegate:self];
AccOcClientInfo* info = [session clientInfo];
[info setDescription:[self key]];
//NSLog(@"Session %@", session);
if (session != nil)
{
//NSLog(@"setting identity (%@) and password (%@)", [identity stringValue], [password stringValue]);
[session setIdentity:[identity stringValue]];
[session setPassword:[password stringValue] forIdentity:[identity stringValue]];
}
[session signOnAction:sender];
Now, with the session has its delegate set to listen for events. Looking at the Java BOT sample (accjbot.java), it showed a listener: public void OnImReceived(AccSession session, AccImSession imSession, AccParticipant participant, AccIm im) What is the Java's OnImReceived equivalent for the AIM.framework? I do notice that the AccOcSession's delegate method shouldAddSecondarySession gets called when there's a new incoming message. It allows me to check the participant's name but not the text message. Many thanks in advance. |
| 23 Jul 2009 - 15:28 | 4686 |
| convosandbox | I was able to receive messages by changing the preferences before signing on:
int accept_all = [[session enumerations] permissionsAcceptAll]; int reject_all = [[session enumerations] permissionsRejectAll]; AccOcPreferences* pref = [session preferences]; [pref setValue:[NSNumber numberWithInt:reject_all] forKeyPath:@"aimcc.im.chat.permissions.buddies"]; [pref setValue:[NSNumber numberWithInt:reject_all] forKeyPath:@"aimcc.im.chat.permissions.nonBuddies"]; [pref setValue:[NSNumber numberWithInt:reject_all] forKeyPath:@"aimcc.im.direct.permissions.buddies"]; [pref setValue:[NSNumber numberWithInt:reject_all] forKeyPath:@"aimcc.im.direct.permissions.nonBuddies"]; [pref setValue:[NSNumber numberWithInt:accept_all] forKeyPath:@"aimcc.im.standard.permissions.buddies"]; [pref setValue:[NSNumber numberWithInt:accept_all] forKeyPath:@"aimcc.im.standard.permissions.nonBuddies"]; And to answer my own previous question as I believe this would benefit any Objective-C developers: The equivalent of Java's OnImReceived is didReceiveIm inside the AccOcImSession class. Before the preferences thing, the didReceiveIm wasn't being fired and got me looking all over the place. Hope this helps you, especially those who are not into bindings. I know for the most of us, getting past the simple part: connectivity, sending and receiving IMs is the least we want our project to work and the rest will be a matter of adding the candies. Last edited by convosandbox (23 Jul 2009 - 15:39) |
| 07 Aug 2009 - 10:15 | 4765 |
| openaimsupport | AIM Frameworks for Mac (samples) Thanks for the above comments and feedback, With respect to bindings... if
you do not want to use bindings, we do support it. Please refer to documentation on KVO programming in Cocoa, which is a prerequisite for doing this. |
| Login to post | Page: « < 1 of 1 > » |
