comparison src/protocols/silc/chat.c @ 9030:7ab20f829190

[gaim-migrate @ 9806] Siege updated the code for creating right-click menu's for buddies, chats, groups, etc. It uses more stuff from the blist API and less stuff from multi.h. It also combines the code for right-click menus for chats, buddies, etc. (all types of blist nodes). So PRPLs and plugins can easily add right-click menu options to anything in the buddy list in a clean way. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 23 May 2004 17:27:45 +0000
parents 4f7c365c5c5a
children 095731b5e4f6
comparison
equal deleted inserted replaced
9029:697e169dac12 9030:7ab20f829190
41 41
42 return ci; 42 return ci;
43 } 43 }
44 44
45 static void 45 static void
46 silcgaim_chat_getinfo(GaimConnection *gc, GHashTable *components); 46 silcgaim_chat_getinfo(GaimBlistNode *node, gpointer data);
47 47
48 static void 48 static void
49 silcgaim_chat_getinfo_res(SilcClient client, 49 silcgaim_chat_getinfo_res(SilcClient client,
50 SilcClientConnection conn, 50 SilcClientConnection conn,
51 SilcChannelEntry *channels, 51 SilcChannelEntry *channels,
71 71
72 silcgaim_chat_getinfo(gc, components); 72 silcgaim_chat_getinfo(gc, components);
73 } 73 }
74 74
75 static void 75 static void
76 silcgaim_chat_getinfo(GaimConnection *gc, GHashTable *components) 76 silcgaim_chat_getinfo(GaimBlistNode *node, gpointer data)
77 { 77 {
78 SilcGaim sg = gc->proto_data; 78 GaimChat *chat;
79 GaimConnection *gc;
80 SilcGaim sg;
81
79 const char *chname; 82 const char *chname;
80 char *buf, tmp[256]; 83 char *buf, tmp[256];
81 GString *s; 84 GString *s;
82 SilcChannelEntry channel; 85 SilcChannelEntry channel;
83 SilcHashTableList htl; 86 SilcHashTableList htl;
84 SilcChannelUser chu; 87 SilcChannelUser chu;
85 88
86 if (!components) 89 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
87 return; 90
88 91 chat = (GaimChat *) node;
89 chname = g_hash_table_lookup(components, "channel"); 92 gc = gaim_account_get_connection(chat->account);
93 sg = gc->proto_data;
94
95 chname = g_hash_table_lookup(chat->components, "channel");
90 if (!chname) 96 if (!chname)
91 return; 97 return;
92 channel = silc_client_get_channel(sg->client, sg->conn, 98 channel = silc_client_get_channel(sg->client, sg->conn,
93 (char *)chname); 99 (char *)chname);
94 if (!channel) { 100 if (!channel) {
95 silc_client_get_channel_resolve(sg->client, sg->conn, 101 silc_client_get_channel_resolve(sg->client, sg->conn,
96 (char *)chname, 102 (char *)chname,
97 silcgaim_chat_getinfo_res, 103 silcgaim_chat_getinfo_res,
98 components); 104 chat->components);
99 return; 105 return;
100 } 106 }
101 107
102 s = g_string_new(""); 108 s = g_string_new("");
103 g_string_append_printf(s, "Channel Name:\t\t%s\n", channel->channel_name); 109 g_string_append_printf(s, "Channel Name:\t\t%s\n", channel->channel_name);
160 #if 0 /* XXX For now these are not implemented. We need better 166 #if 0 /* XXX For now these are not implemented. We need better
161 listview dialog from Gaim for these. */ 167 listview dialog from Gaim for these. */
162 /************************** Channel Invite List ******************************/ 168 /************************** Channel Invite List ******************************/
163 169
164 static void 170 static void
165 silcgaim_chat_invitelist(GaimConnection *gc, GHashTable *components) 171 silcgaim_chat_invitelist(GaimBlistNode *node, gpointer data);
166 { 172 {
167 173
168 } 174 }
169 175
170 176
171 /**************************** Channel Ban List *******************************/ 177 /**************************** Channel Ban List *******************************/
172 178
173 static void 179 static void
174 silcgaim_chat_banlist(GaimConnection *gc, GHashTable *components) 180 silcgaim_chat_banlist(GaimBlistNode *node, gpointer data);
175 { 181 {
176 182
177 } 183 }
178 #endif 184 #endif
179 185
438 444
439 silc_argument_payload_free(chpks); 445 silc_argument_payload_free(chpks);
440 } 446 }
441 447
442 static void 448 static void
443 silcgaim_chat_chauth(GaimConnection *gc, GHashTable *components) 449 silcgaim_chat_chauth(GaimBlistNode *node, gpointer data)
444 { 450 {
445 SilcGaim sg = gc->proto_data; 451 GaimChat *chat;
452 GaimConnection *gc;
453 SilcGaim sg;
454
455 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
456
457 chat = (GaimChat *) node;
458 gc = gaim_account_get_connection(chat->account);
459 sg = gc->proto_data;
460
446 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", 461 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
447 g_hash_table_lookup(components, "channel"), 462 g_hash_table_lookup(chat->components, "channel"),
448 "+C", NULL); 463 "+C", NULL);
449 } 464 }
450 465
451 466
452 /************************** Channel Private Groups **************************/ 467 /************************** Channel Private Groups **************************/
511 { 526 {
512 silc_free(p); 527 silc_free(p);
513 } 528 }
514 529
515 static void 530 static void
516 silcgaim_chat_prv(GaimConnection *gc, GHashTable *components) 531 silcgaim_chat_prv(GaimBlistNode *node, gpointer data)
517 { 532 {
518 SilcGaim sg = gc->proto_data; 533 GaimChat *chat;
534 GaimConnection *gc;
535 SilcGaim sg;
536
519 SilcGaimCharPrv p; 537 SilcGaimCharPrv p;
520 GaimRequestFields *fields; 538 GaimRequestFields *fields;
521 GaimRequestFieldGroup *g; 539 GaimRequestFieldGroup *g;
522 GaimRequestField *f; 540 GaimRequestField *f;
523 char tmp[512]; 541 char tmp[512];
524 542
543 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
544
545 chat = (GaimChat *) node;
546 gc = gaim_account_get_connection(chat->account);
547 sg = gc->proto_data;
548
525 p = silc_calloc(1, sizeof(*p)); 549 p = silc_calloc(1, sizeof(*p));
526 if (!p) 550 if (!p)
527 return; 551 return;
528 p->sg = sg; 552 p->sg = sg;
529 553
530 p->channel = g_hash_table_lookup(components, "channel"); 554 p->channel = g_hash_table_lookup(chat->components, "channel");
531 p->c = gaim_blist_find_chat(sg->account, p->channel); 555 p->c = gaim_blist_find_chat(sg->account, p->channel);
532 556
533 fields = gaim_request_fields_new(); 557 fields = gaim_request_fields_new();
534 558
535 g = gaim_request_field_group_new(NULL); 559 g = gaim_request_field_group_new(NULL);
557 581
558 582
559 /****************************** Channel Modes ********************************/ 583 /****************************** Channel Modes ********************************/
560 584
561 static void 585 static void
562 silcgaim_chat_permanent_reset(GaimConnection *gc, GHashTable *components) 586 silcgaim_chat_permanent_reset(GaimBlistNode *node, gpointer data)
563 { 587 {
564 SilcGaim sg = gc->proto_data; 588 GaimChat *chat;
589 GaimConnection *gc;
590 SilcGaim sg;
591
592 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
593
594 chat = (GaimChat *) node;
595 gc = gaim_account_get_connection(chat->account);
596 sg = gc->proto_data;
597
565 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", 598 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
566 g_hash_table_lookup(components, "channel"), 599 g_hash_table_lookup(chat->components, "channel"),
567 "-f", NULL); 600 "-f", NULL);
568 } 601 }
569 602
570 static void 603 static void
571 silcgaim_chat_permanent(GaimConnection *gc, GHashTable *components) 604 silcgaim_chat_permanent(GaimBlistNode *node, gpointer data)
572 { 605 {
573 SilcGaim sg = gc->proto_data; 606 GaimChat *chat;
607 GaimConnection *gc;
608 SilcGaim sg;
574 const char *channel; 609 const char *channel;
610
611 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
612
613 chat = (GaimChat *) node;
614 gc = gaim_account_get_connection(chat->account);
615 sg = gc->proto_data;
575 616
576 if (!sg->conn) 617 if (!sg->conn)
577 return; 618 return;
578 619
579 /* XXX we should have ability to define which founder 620 /* XXX we should have ability to define which founder
580 key to use. Now we use the user's own public key 621 key to use. Now we use the user's own public key
581 (default key). */ 622 (default key). */
582 623
583 /* Call CMODE */ 624 /* Call CMODE */
584 channel = g_hash_table_lookup(components, "channel"); 625 channel = g_hash_table_lookup(chat->components, "channel");
585 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", channel, 626 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", channel,
586 "+f", NULL); 627 "+f", NULL);
587 } 628 }
588 629
589 typedef struct { 630 typedef struct {
627 668
628 silc_free(s); 669 silc_free(s);
629 } 670 }
630 671
631 static void 672 static void
632 silcgaim_chat_ulimit(GaimConnection *gc, GHashTable *components) 673 silcgaim_chat_ulimit(GaimBlistNode *node, gpointer data)
633 { 674 {
634 SilcGaim sg = gc->proto_data; 675 GaimChat *chat;
676 GaimConnection *gc;
677 SilcGaim sg;
678
635 SilcGaimChatInput s; 679 SilcGaimChatInput s;
636 SilcChannelEntry channel; 680 SilcChannelEntry channel;
637 const char *ch; 681 const char *ch;
638 char tmp[32]; 682 char tmp[32];
639 683
684 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
685
686 chat = (GaimChat *) node;
687 gc = gaim_account_get_connection(chat->account);
688 sg = gc->proto_data;
689
640 if (!sg->conn) 690 if (!sg->conn)
641 return; 691 return;
642 692
643 ch = g_strdup(g_hash_table_lookup(components, "channel")); 693 ch = g_strdup(g_hash_table_lookup(chat->components, "channel"));
644 channel = silc_client_get_channel(sg->client, sg->conn, (char *)ch); 694 channel = silc_client_get_channel(sg->client, sg->conn, (char *)ch);
645 if (!channel) 695 if (!channel)
646 return; 696 return;
647 697
648 s = silc_calloc(1, sizeof(*s)); 698 s = silc_calloc(1, sizeof(*s));
657 _("OK"), G_CALLBACK(silcgaim_chat_ulimit_cb), 707 _("OK"), G_CALLBACK(silcgaim_chat_ulimit_cb),
658 _("Cancel"), G_CALLBACK(silcgaim_chat_ulimit_cb), s); 708 _("Cancel"), G_CALLBACK(silcgaim_chat_ulimit_cb), s);
659 } 709 }
660 710
661 static void 711 static void
662 silcgaim_chat_resettopic(GaimConnection *gc, GHashTable *components) 712 silcgaim_chat_resettopic(GaimBlistNode *node, gpointer data)
663 { 713 {
664 SilcGaim sg = gc->proto_data; 714 GaimChat *chat;
715 GaimConnection *gc;
716 SilcGaim sg;
717
718 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
719
720 chat = (GaimChat *) node;
721 gc = gaim_account_get_connection(chat->account);
722 sg = gc->proto_data;
723
665 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", 724 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
666 g_hash_table_lookup(components, "channel"), 725 g_hash_table_lookup(chat->components, "channel"),
667 "-t", NULL); 726 "-t", NULL);
668 } 727 }
669 728
670 static void 729 static void
671 silcgaim_chat_settopic(GaimConnection *gc, GHashTable *components) 730 silcgaim_chat_settopic(GaimBlistNode *node, gpointer data)
672 { 731 {
673 SilcGaim sg = gc->proto_data; 732 GaimChat *chat;
733 GaimConnection *gc;
734 SilcGaim sg;
735
736 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
737
738 chat = (GaimChat *) node;
739 gc = gaim_account_get_connection(chat->account);
740 sg = gc->proto_data;
741
674 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", 742 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
675 g_hash_table_lookup(components, "channel"), 743 g_hash_table_lookup(chat->components, "channel"),
676 "+t", NULL); 744 "+t", NULL);
677 } 745 }
678 746
679 static void 747 static void
680 silcgaim_chat_resetprivate(GaimConnection *gc, GHashTable *components) 748 silcgaim_chat_resetprivate(GaimBlistNode *node, gpointer data)
681 { 749 {
682 SilcGaim sg = gc->proto_data; 750 GaimChat *chat;
751 GaimConnection *gc;
752 SilcGaim sg;
753
754 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
755
756 chat = (GaimChat *) node;
757 gc = gaim_account_get_connection(chat->account);
758 sg = gc->proto_data;
759
683 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", 760 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
684 g_hash_table_lookup(components, "channel"), 761 g_hash_table_lookup(chat->components, "channel"),
685 "-p", NULL); 762 "-p", NULL);
686 } 763 }
687 764
688 static void 765 static void
689 silcgaim_chat_setprivate(GaimConnection *gc, GHashTable *components) 766 silcgaim_chat_setprivate(GaimBlistNode *node, gpointer data)
690 { 767 {
691 SilcGaim sg = gc->proto_data; 768 GaimChat *chat;
769 GaimConnection *gc;
770 SilcGaim sg;
771
772 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
773
774 chat = (GaimChat *) node;
775 gc = gaim_account_get_connection(chat->account);
776 sg = gc->proto_data;
777
692 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", 778 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
693 g_hash_table_lookup(components, "channel"), 779 g_hash_table_lookup(chat->components, "channel"),
694 "+p", NULL); 780 "+p", NULL);
695 } 781 }
696 782
697 static void 783 static void
698 silcgaim_chat_resetsecret(GaimConnection *gc, GHashTable *components) 784 silcgaim_chat_resetsecret(GaimBlistNode *node, gpointer data)
699 { 785 {
700 SilcGaim sg = gc->proto_data; 786 GaimChat *chat;
787 GaimConnection *gc;
788 SilcGaim sg;
789
790 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
791
792 chat = (GaimChat *) node;
793 gc = gaim_account_get_connection(chat->account);
794 sg = gc->proto_data;
795
701 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", 796 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
702 g_hash_table_lookup(components, "channel"), 797 g_hash_table_lookup(chat->components, "channel"),
703 "-s", NULL); 798 "-s", NULL);
704 } 799 }
705 800
706 static void 801 static void
707 silcgaim_chat_setsecret(GaimConnection *gc, GHashTable *components) 802 silcgaim_chat_setsecret(GaimBlistNode *node, gpointer data)
708 { 803 {
709 SilcGaim sg = gc->proto_data; 804 GaimChat *chat;
805 GaimConnection *gc;
806 SilcGaim sg;
807
808 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node));
809
810 chat = (GaimChat *) node;
811 gc = gaim_account_get_connection(chat->account);
812 sg = gc->proto_data;
813
710 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE", 814 silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
711 g_hash_table_lookup(components, "channel"), 815 g_hash_table_lookup(chat->components, "channel"),
712 "+s", NULL); 816 "+s", NULL);
713 } 817 }
714 818
715 GList *silcgaim_chat_menu(GaimConnection *gc, GHashTable *components) 819 GList *silcgaim_chat_menu(GaimChat *chat)
716 { 820 {
821 GHashTable components = chat->components;
822 GaimConnection *gc = gaim_account_get_connection(chat->account);
717 SilcGaim sg = gc->proto_data; 823 SilcGaim sg = gc->proto_data;
718 SilcClientConnection conn = sg->conn; 824 SilcClientConnection conn = sg->conn;
719 GList *m = NULL;
720 struct proto_chat_menu *pcm;
721 const char *chname = NULL; 825 const char *chname = NULL;
722 SilcChannelEntry channel = NULL; 826 SilcChannelEntry channel = NULL;
723 SilcChannelUser chu = NULL; 827 SilcChannelUser chu = NULL;
724 SilcUInt32 mode = 0; 828 SilcUInt32 mode = 0;
829
830 GList *m;
831 GaimBlistNodeAction *act;
725 832
726 if (components) 833 if (components)
727 chname = g_hash_table_lookup(components, "channel"); 834 chname = g_hash_table_lookup(components, "channel");
728 if (chname) 835 if (chname)
729 channel = silc_client_get_channel(sg->client, sg->conn, 836 channel = silc_client_get_channel(sg->client, sg->conn,
735 } 842 }
736 843
737 if (strstr(chname, "[Private Group]")) 844 if (strstr(chname, "[Private Group]"))
738 return NULL; 845 return NULL;
739 846
740 pcm = g_new0(struct proto_chat_menu, 1); 847 act = gaim_blist_node_action_new(_("Get Info"),
741 pcm->label = _("Get Info"); 848 silcgaim_chat_getinfo, NULL);
742 pcm->callback = silcgaim_chat_getinfo; 849 m = g_list_append(m, act);
743 pcm->gc = gc;
744 m = g_list_append(m, pcm);
745 850
746 #if 0 /* XXX For now these are not implemented. We need better 851 #if 0 /* XXX For now these are not implemented. We need better
747 listview dialog from Gaim for these. */ 852 listview dialog from Gaim for these. */
748 if (mode & SILC_CHANNEL_UMODE_CHANOP) { 853 if (mode & SILC_CHANNEL_UMODE_CHANOP) {
749 pcm = g_new0(struct proto_chat_menu, 1); 854 act = gaim_blist_node_action_new(_("Invite List"),
750 pcm->label = _("Invite List"); 855 silcgaim_chat_invitelist, NULL);
751 pcm->callback = silcgaim_chat_invitelist; 856 m = g_list_append(m, act);
752 pcm->gc = gc; 857
753 m = g_list_append(m, pcm); 858 act = gaim_blist_node_action_new(_("Ban List"),
754 859 silcgaim_chat_banlist, NULL);
755 pcm = g_new0(struct proto_chat_menu, 1); 860 m = g_list_append(m, act);
756 pcm->label = _("Ban List");
757 pcm->callback = silcgaim_chat_banlist;
758 pcm->gc = gc;
759 m = g_list_append(m, pcm);
760 } 861 }
761 #endif 862 #endif
762 863
763 if (chu) { 864 if (chu) {
764 pcm = g_new0(struct proto_chat_menu, 1); 865 act = gaim_blist_node_action_new(_("Add Private Group"),
765 pcm->label = _("Add Private Group"); 866 silcgaim_chat_prv, NULL);
766 pcm->callback = silcgaim_chat_prv; 867 m = g_list_append(m, act);
767 pcm->gc = gc;
768 m = g_list_append(m, pcm);
769 } 868 }
770 869
771 if (mode & SILC_CHANNEL_UMODE_CHANFO) { 870 if (mode & SILC_CHANNEL_UMODE_CHANFO) {
772 pcm = g_new0(struct proto_chat_menu, 1); 871 act = gaim_blist_node_action_new(_("Channel Authentication"),
773 pcm->label = _("Channel Authentication"); 872 silcgaim_chat_chauth, NULL);
774 pcm->callback = silcgaim_chat_chauth; 873 m = g_list_append(m, act);
775 pcm->gc = gc;
776 m = g_list_append(m, pcm);
777 874
778 if (channel->mode & SILC_CHANNEL_MODE_FOUNDER_AUTH) { 875 if (channel->mode & SILC_CHANNEL_MODE_FOUNDER_AUTH) {
779 pcm = g_new0(struct proto_chat_menu, 1); 876 act = gaim_blist_node_action_new(_("Reset Permanent"),
780 pcm->label = _("Reset Permanent"); 877 silcgaim_chat_permanent_reset, NULL);
781 pcm->callback = silcgaim_chat_permanent_reset; 878 m = g_list_append(m, act);
782 pcm->gc = gc;
783 m = g_list_append(m, pcm);
784 } else { 879 } else {
785 pcm = g_new0(struct proto_chat_menu, 1); 880 act = gaim_blist_node_action_new(_("Set Permanent"),
786 pcm->label = _("Set Permanent"); 881 silcgaim_chat_permanent, NULL);
787 pcm->callback = silcgaim_chat_permanent; 882 m = g_list_append(m, act);
788 pcm->gc = gc;
789 m = g_list_append(m, pcm);
790 } 883 }
791 } 884 }
792 885
793 if (mode & SILC_CHANNEL_UMODE_CHANOP) { 886 if (mode & SILC_CHANNEL_UMODE_CHANOP) {
794 pcm = g_new0(struct proto_chat_menu, 1); 887 act = gaim_blist_node_action_new(_("Set User Limit"),
795 pcm->label = _("Set User Limit"); 888 silcgaim_chat_ulimit, NULL);
796 pcm->callback = silcgaim_chat_ulimit; 889 m = g_list_append(m, act);
797 pcm->gc = gc;
798 m = g_list_append(m, pcm);
799 890
800 if (channel->mode & SILC_CHANNEL_MODE_TOPIC) { 891 if (channel->mode & SILC_CHANNEL_MODE_TOPIC) {
801 pcm = g_new0(struct proto_chat_menu, 1); 892 act = gaim_blist_node_action_new(_("Reset Topic Restriction"),
802 pcm->label = _("Reset Topic Restriction"); 893 silcgaim_chat_resettopic, NULL);
803 pcm->callback = silcgaim_chat_resettopic; 894 m = g_list_append(m, act);
804 pcm->gc = gc;
805 m = g_list_append(m, pcm);
806 } else { 895 } else {
807 pcm = g_new0(struct proto_chat_menu, 1); 896 act = gaim_blist_node_action_new(_("Set Topic Restriction"),
808 pcm->label = _("Set Topic Restriction"); 897 silcgaim_chat_settopic, NULL);
809 pcm->callback = silcgaim_chat_settopic; 898 m = g_list_append(m, act);
810 pcm->gc = gc;
811 m = g_list_append(m, pcm);
812 } 899 }
813 900
814 if (channel->mode & SILC_CHANNEL_MODE_PRIVATE) { 901 if (channel->mode & SILC_CHANNEL_MODE_PRIVATE) {
815 pcm = g_new0(struct proto_chat_menu, 1); 902 act = gaim_blist_node_action_new(_("Reset Private Channel"),
816 pcm->label = _("Reset Private Channel"); 903 silcgaim_chat_resetprivate, NULL);
817 pcm->callback = silcgaim_chat_resetprivate; 904 m = g_list_append(m, act);
818 pcm->gc = gc;
819 m = g_list_append(m, pcm);
820 } else { 905 } else {
821 pcm = g_new0(struct proto_chat_menu, 1); 906 act = gaim_blist_node_action_new(_("Set Private Channel"),
822 pcm->label = _("Set Private Channel"); 907 silcgaim_chat_setprivate, NULL);
823 pcm->callback = silcgaim_chat_setprivate; 908 m = g_list_append(m, act);
824 pcm->gc = gc;
825 m = g_list_append(m, pcm);
826 } 909 }
827 910
828 if (channel->mode & SILC_CHANNEL_MODE_SECRET) { 911 if (channel->mode & SILC_CHANNEL_MODE_SECRET) {
829 pcm = g_new0(struct proto_chat_menu, 1); 912 act = gaim_blist_node_action_new(_("Reset Secret Channel"),
830 pcm->label = _("Reset Secret Channel"); 913 silcgaim_chat_resetsecret, NULL);
831 pcm->callback = silcgaim_chat_resetsecret; 914 m = g_list_append(m, act);
832 pcm->gc = gc;
833 m = g_list_append(m, pcm);
834 } else { 915 } else {
835 pcm = g_new0(struct proto_chat_menu, 1); 916 act = gaim_blist_node_action_new(_("Set Secret Channel"),
836 pcm->label = _("Set Secret Channel"); 917 silcgaim_chat_setsecret, NULL);
837 pcm->callback = silcgaim_chat_setsecret; 918 m = g_list_append(m, act);
838 pcm->gc = gc;
839 m = g_list_append(m, pcm);
840 } 919 }
841 } 920 }
842 921
843 return m; 922 return m;
844 } 923 }