src/protocols/silc/silc.c

changeset 9015
3c27e9074fa2
parent 8993
41f67bceab41
child 9024
ae04c67ba5db
equal deleted inserted replaced
9014:047e5fb72251 9015:3c27e9074fa2
523 SILC_ATTRIBUTE_TIMEZONE, 523 SILC_ATTRIBUTE_TIMEZONE,
524 (void *)val, strlen(val)); 524 (void *)val, strlen(val));
525 } 525 }
526 526
527 static void 527 static void
528 silcgaim_attrs(GaimConnection *gc) 528 silcgaim_attrs(GaimPluginAction *action)
529 { 529 {
530 GaimConnection *gc = (GaimConnection *) action->context;
530 SilcGaim sg = gc->proto_data; 531 SilcGaim sg = gc->proto_data;
531 SilcClient client = sg->client; 532 SilcClient client = sg->client;
532 SilcClientConnection conn = sg->conn; 533 SilcClientConnection conn = sg->conn;
533 GaimRequestFields *fields; 534 GaimRequestFields *fields;
534 GaimRequestFieldGroup *g; 535 GaimRequestFieldGroup *g;
687 _("OK"), G_CALLBACK(silcgaim_attrs_cb), 688 _("OK"), G_CALLBACK(silcgaim_attrs_cb),
688 _("Cancel"), G_CALLBACK(silcgaim_attrs_cancel), gc); 689 _("Cancel"), G_CALLBACK(silcgaim_attrs_cancel), gc);
689 } 690 }
690 691
691 static void 692 static void
692 silcgaim_detach(GaimConnection *gc) 693 silcgaim_detach(GaimPluginAction *action)
693 { 694 {
695 GaimConnection *gc = (GaimConnection *) action->context;
694 SilcGaim sg; 696 SilcGaim sg;
695 697
696 if (!gc) 698 if (!gc)
697 return; 699 return;
698 sg = gc->proto_data; 700 sg = gc->proto_data;
703 silc_client_command_call(sg->client, sg->conn, "DETACH"); 705 silc_client_command_call(sg->client, sg->conn, "DETACH");
704 sg->detaching = TRUE; 706 sg->detaching = TRUE;
705 } 707 }
706 708
707 static void 709 static void
708 silcgaim_view_motd(GaimConnection *gc) 710 silcgaim_view_motd(GaimPluginAction *action)
709 { 711 {
712 GaimConnection *gc = (GaimConnection *) action->context;
710 SilcGaim sg; 713 SilcGaim sg;
711 714
712 if (!gc) 715 if (!gc)
713 return; 716 return;
714 sg = gc->proto_data; 717 sg = gc->proto_data;
725 gaim_notify_formatted(gc, "Message of the Day", "Message of the Day", NULL, 728 gaim_notify_formatted(gc, "Message of the Day", "Message of the Day", NULL,
726 sg->motd, NULL, NULL); 729 sg->motd, NULL, NULL);
727 } 730 }
728 731
729 static GList * 732 static GList *
730 silcgaim_actions(GaimConnection *gc) 733 silcgaim_actions(GaimPlugin *plugin, gpointer context)
731 { 734 {
732 struct proto_actions_menu *pam;
733 GList *list = NULL; 735 GList *list = NULL;
736 GaimPluginAction *act;
734 737
735 if (!gaim_account_get_bool(gc->account, "reject-attrs", FALSE)) { 738 if (!gaim_account_get_bool(gc->account, "reject-attrs", FALSE)) {
736 pam = g_new0(struct proto_actions_menu, 1); 739 act = gaim_plugin_action_new(_("Online Status"),
737 pam->label = _("Online Status"); 740 silcgaim_attrs);
738 pam->callback = silcgaim_attrs; 741 list = g_list_append(list, act);
739 pam->gc = gc; 742 }
740 list = g_list_append(list, pam); 743
741 } 744 act = gaim_plugin_action_new(_("Detach From Server"),
742 745 silcgaim_detach);
743 pam = g_new0(struct proto_actions_menu, 1); 746 list = g_list_append(list, act);
744 pam->label = _("Detach From Server"); 747
745 pam->callback = silcgaim_detach; 748 act = gaim_plugin_action_new(_("View Message of the Day"),
746 pam->gc = gc; 749 silcgaim_view_motd);
747 list = g_list_append(list, pam); 750 list = g_list_append(list, act);
748
749 pam = g_new0(struct proto_actions_menu, 1);
750 pam->label = _("View Message of the Day");
751 pam->callback = silcgaim_view_motd;
752 pam->gc = gc;
753 list = g_list_append(list, pam);
754 751
755 return list; 752 return list;
756 } 753 }
757 754
758 755
949 silcgaim_list_icon, 946 silcgaim_list_icon,
950 silcgaim_list_emblems, 947 silcgaim_list_emblems,
951 silcgaim_status_text, 948 silcgaim_status_text,
952 silcgaim_tooltip_text, 949 silcgaim_tooltip_text,
953 silcgaim_away_states, 950 silcgaim_away_states,
954 silcgaim_actions,
955 silcgaim_buddy_menu, 951 silcgaim_buddy_menu,
956 silcgaim_chat_info, 952 silcgaim_chat_info,
957 silcgaim_login, 953 silcgaim_login,
958 silcgaim_close, 954 silcgaim_close,
959 silcgaim_send_im, 955 silcgaim_send_im,
1024 NULL, /**< destroy */ 1020 NULL, /**< destroy */
1025 1021
1026 NULL, /**< ui_info */ 1022 NULL, /**< ui_info */
1027 &prpl_info, /**< extra_info */ 1023 &prpl_info, /**< extra_info */
1028 &prefs_info, /**< prefs_info */ 1024 &prefs_info, /**< prefs_info */
1029 NULL 1025 silcgaim_actions
1030 }; 1026 };
1031 1027
1032 static void 1028 static void
1033 init_plugin(GaimPlugin *plugin) 1029 init_plugin(GaimPlugin *plugin)
1034 { 1030 {

mercurial