Mercurial > pidgin.yaz
comparison libgaim/protocols/oscar/family_oservice.c @ 15086:f3573d941d66
[gaim-migrate @ 17871]
Minor cleanup. Mostly make some functions void instead of int where the
return value was always 0 and wasn't used
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 02 Dec 2006 08:03:45 +0000 |
parents | e0a93e6fa98b |
children | eed75cc6cb88 |
comparison
equal
deleted
inserted
replaced
15085:e0d70bba8290 | 15086:f3573d941d66 |
---|---|
91 * Note that we must send this before we request rates, since | 91 * Note that we must send this before we request rates, since |
92 * the format of the rate information depends on the versions we | 92 * the format of the rate information depends on the versions we |
93 * give it. | 93 * give it. |
94 * | 94 * |
95 */ | 95 */ |
96 aim_setversions(od, conn); | 96 aim_srv_setversions(od, conn); |
97 | 97 |
98 return 1; | 98 return 1; |
99 } | 99 } |
100 | 100 |
101 /* Subtype 0x0004 - Service request */ | 101 /* Subtype 0x0004 - Service request */ |
102 int aim_reqservice(OscarData *od, guint16 serviceid) | 102 void |
103 aim_srv_requestnew(OscarData *od, guint16 serviceid) | |
103 { | 104 { |
104 FlapConnection *conn; | 105 FlapConnection *conn; |
105 | 106 |
106 conn = flap_connection_findbygroup(od, SNAC_FAMILY_BOS); | 107 conn = flap_connection_findbygroup(od, SNAC_FAMILY_BOS); |
107 | 108 |
108 return aim_genericreq_s(od, conn, 0x0001, 0x0004, &serviceid); | 109 aim_genericreq_s(od, conn, 0x0001, 0x0004, &serviceid); |
109 } | 110 } |
110 | 111 |
111 /* | 112 /* |
112 * Join a room of name roomname. This is the first step to joining an | 113 * Join a room of name roomname. This is the first step to joining an |
113 * already created room. It's basically a Service Request for | 114 * already created room. It's basically a Service Request for |
203 return ret; | 204 return ret; |
204 } | 205 } |
205 | 206 |
206 /* Subtype 0x0006 - Request Rate Information. */ | 207 /* Subtype 0x0006 - Request Rate Information. */ |
207 void | 208 void |
208 aim_reqrates(OscarData *od, FlapConnection *conn) | 209 aim_srv_reqrates(OscarData *od, FlapConnection *conn) |
209 { | 210 { |
210 aim_genericreq_n_snacid(od, conn, 0x0001, 0x0006); | 211 aim_genericreq_n_snacid(od, conn, 0x0001, 0x0006); |
211 } | 212 } |
212 | 213 |
213 /* | 214 /* |
254 * | 255 * |
255 * The last thing that needs to be learned about the rate limiting | 256 * The last thing that needs to be learned about the rate limiting |
256 * system is how the actual numbers relate to the passing of time. This | 257 * system is how the actual numbers relate to the passing of time. This |
257 * seems to be a big mystery. | 258 * seems to be a big mystery. |
258 * | 259 * |
260 * See joscar's javadoc for the RateClassInfo class for a great | |
261 * explanation. You might be able to find it at | |
262 * http://dscoder.com/RateClassInfo.html | |
259 */ | 263 */ |
260 | 264 |
261 static void | 265 static void |
262 rc_addclass(struct rateclass **head, struct rateclass *inrc) | 266 rc_addclass(struct rateclass **head, struct rateclass *inrc) |
263 { | 267 { |
381 | 385 |
382 /* | 386 /* |
383 * Last step in the conn init procedure is to acknowledge that we | 387 * Last step in the conn init procedure is to acknowledge that we |
384 * agree to these draconian limitations. | 388 * agree to these draconian limitations. |
385 */ | 389 */ |
386 aim_rates_addparam(od, conn); | 390 aim_srv_rates_addparam(od, conn); |
387 | 391 |
388 /* | 392 /* |
389 * Finally, tell the client it's ready to go... | 393 * Finally, tell the client it's ready to go... |
390 */ | 394 */ |
391 if ((userfunc = aim_callhandler(od, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE))) | 395 if ((userfunc = aim_callhandler(od, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE))) |
394 return 1; | 398 return 1; |
395 } | 399 } |
396 | 400 |
397 /* Subtype 0x0008 - Add Rate Parameter */ | 401 /* Subtype 0x0008 - Add Rate Parameter */ |
398 void | 402 void |
399 aim_rates_addparam(OscarData *od, FlapConnection *conn) | 403 aim_srv_rates_addparam(OscarData *od, FlapConnection *conn) |
400 { | 404 { |
401 FlapFrame *frame; | 405 FlapFrame *frame; |
402 aim_snacid_t snacid; | 406 aim_snacid_t snacid; |
403 struct rateclass *rc; | 407 struct rateclass *rc; |
404 | 408 |
413 flap_connection_send(conn, frame); | 417 flap_connection_send(conn, frame); |
414 } | 418 } |
415 | 419 |
416 /* Subtype 0x0009 - Delete Rate Parameter */ | 420 /* Subtype 0x0009 - Delete Rate Parameter */ |
417 void | 421 void |
418 aim_rates_delparam(OscarData *od, FlapConnection *conn) | 422 aim_srv_rates_delparam(OscarData *od, FlapConnection *conn) |
419 { | 423 { |
420 FlapFrame *frame; | 424 FlapFrame *frame; |
421 aim_snacid_t snacid; | 425 aim_snacid_t snacid; |
422 struct rateclass *rc; | 426 struct rateclass *rc; |
423 | 427 |
485 } | 489 } |
486 | 490 |
487 /* | 491 /* |
488 * Subtype 0x000c - Service Pause Acknowledgement | 492 * Subtype 0x000c - Service Pause Acknowledgement |
489 * | 493 * |
490 * It is rather important that aim_sendpauseack() gets called for the exact | 494 * It is rather important that aim_srv_sendpauseack() gets called for the exact |
491 * same connection that the Server Pause callback was called for, since | 495 * same connection that the Server Pause callback was called for, since |
492 * libfaim extracts the data for the SNAC from the connection structure. | 496 * libfaim extracts the data for the SNAC from the connection structure. |
493 * | 497 * |
494 * Of course, if you don't do that, more bad things happen than just what | 498 * Of course, if you don't do that, more bad things happen than just what |
495 * libfaim can cause. | 499 * libfaim can cause. |
496 * | 500 * |
497 */ | 501 */ |
498 void | 502 void |
499 aim_sendpauseack(OscarData *od, FlapConnection *conn) | 503 aim_srv_sendpauseack(OscarData *od, FlapConnection *conn) |
500 { | 504 { |
501 FlapFrame *frame; | 505 FlapFrame *frame; |
502 aim_snacid_t snacid; | 506 aim_snacid_t snacid; |
503 GSList *cur; | 507 GSList *cur; |
504 | 508 |
531 return ret; | 535 return ret; |
532 } | 536 } |
533 | 537 |
534 /* Subtype 0x000e - Request self-info */ | 538 /* Subtype 0x000e - Request self-info */ |
535 void | 539 void |
536 aim_reqpersonalinfo(OscarData *od, FlapConnection *conn) | 540 aim_srv_reqpersonalinfo(OscarData *od, FlapConnection *conn) |
537 { | 541 { |
538 aim_genericreq_n_snacid(od, conn, 0x0001, 0x000e); | 542 aim_genericreq_n_snacid(od, conn, 0x0001, 0x000e); |
539 } | 543 } |
540 | 544 |
541 /* Subtype 0x000f - Self User Info */ | 545 /* Subtype 0x000f - Self User Info */ |
587 * never be called consecutively with a non-zero idle time. That makes | 591 * never be called consecutively with a non-zero idle time. That makes |
588 * OSCAR do funny things. Instead, just set it once you go idle, and then | 592 * OSCAR do funny things. Instead, just set it once you go idle, and then |
589 * call it again with zero when you're back. | 593 * call it again with zero when you're back. |
590 * | 594 * |
591 */ | 595 */ |
592 int | 596 void |
593 aim_srv_setidle(OscarData *od, guint32 idletime) | 597 aim_srv_setidle(OscarData *od, guint32 idletime) |
594 { | 598 { |
595 FlapConnection *conn; | 599 FlapConnection *conn; |
596 | 600 |
597 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_BOS))) | 601 conn = flap_connection_findbygroup(od, SNAC_FAMILY_BOS); |
598 return -EINVAL; | 602 aim_genericreq_l(od, conn, 0x0001, 0x0011, &idletime); |
599 | |
600 return aim_genericreq_l(od, conn, 0x0001, 0x0011, &idletime); | |
601 } | 603 } |
602 | 604 |
603 /* | 605 /* |
604 * Subtype 0x0012 - Service Migrate | 606 * Subtype 0x0012 - Service Migrate |
605 * | 607 * |
701 * | 703 * |
702 * Bit 1: Allows other AIM users to see how long you've been idle. | 704 * Bit 1: Allows other AIM users to see how long you've been idle. |
703 * Bit 2: Allows other AIM users to see how long you've been a member. | 705 * Bit 2: Allows other AIM users to see how long you've been a member. |
704 * | 706 * |
705 */ | 707 */ |
706 int | 708 void |
707 aim_bos_setprivacyflags(OscarData *od, FlapConnection *conn, guint32 flags) | 709 aim_srv_setprivacyflags(OscarData *od, FlapConnection *conn, guint32 flags) |
708 { | 710 { |
709 return aim_genericreq_l(od, conn, 0x0001, 0x0014, &flags); | 711 aim_genericreq_l(od, conn, 0x0001, 0x0014, &flags); |
710 } | 712 } |
711 | 713 |
712 /* | 714 /* |
713 * Subtype 0x0016 - No-op | 715 * Subtype 0x0016 - No-op |
714 * | 716 * |
716 * really necessary. | 718 * really necessary. |
717 * | 719 * |
718 * Wha? No? Since when? I think WinAIM sends an empty channel 5 | 720 * Wha? No? Since when? I think WinAIM sends an empty channel 5 |
719 * FLAP as a no-op... | 721 * FLAP as a no-op... |
720 */ | 722 */ |
721 int | 723 void |
722 aim_nop(OscarData *od, FlapConnection *conn) | 724 aim_srv_nop(OscarData *od, FlapConnection *conn) |
723 { | 725 { |
724 return aim_genericreq_n(od, conn, 0x0001, 0x0016); | 726 aim_genericreq_n(od, conn, 0x0001, 0x0016); |
725 } | 727 } |
726 | 728 |
727 /* | 729 /* |
728 * Subtype 0x0017 - Set client versions | 730 * Subtype 0x0017 - Set client versions |
729 * | 731 * |
736 * We can see them already making use of this by changing the format of | 738 * We can see them already making use of this by changing the format of |
737 * the rate information based on what version of group 1 we advertise here. | 739 * the rate information based on what version of group 1 we advertise here. |
738 * | 740 * |
739 */ | 741 */ |
740 void | 742 void |
741 aim_setversions(OscarData *od, FlapConnection *conn) | 743 aim_srv_setversions(OscarData *od, FlapConnection *conn) |
742 { | 744 { |
743 FlapFrame *frame; | 745 FlapFrame *frame; |
744 aim_snacid_t snacid; | 746 aim_snacid_t snacid; |
745 GSList *cur; | 747 GSList *cur; |
746 | 748 |
780 free(versions); | 782 free(versions); |
781 | 783 |
782 /* | 784 /* |
783 * Now request rates. | 785 * Now request rates. |
784 */ | 786 */ |
785 aim_reqrates(od, conn); | 787 aim_srv_reqrates(od, conn); |
786 | 788 |
787 return 1; | 789 return 1; |
788 } | 790 } |
789 | 791 |
790 /* | 792 /* |
803 * also set 0x0008 and 0x000c. | 805 * also set 0x0008 and 0x000c. |
804 * | 806 * |
805 * TODO: Combine this with the function below. | 807 * TODO: Combine this with the function below. |
806 */ | 808 */ |
807 int | 809 int |
808 aim_setextstatus(OscarData *od, guint32 status) | 810 aim_srv_setextstatus(OscarData *od, guint32 status) |
809 { | 811 { |
810 FlapConnection *conn; | 812 FlapConnection *conn; |
811 FlapFrame *frame; | 813 FlapFrame *frame; |
812 aim_snacid_t snacid; | 814 aim_snacid_t snacid; |
813 aim_tlvlist_t *tl = NULL; | 815 aim_tlvlist_t *tl = NULL; |