comparison src/protocols/zephyr/zephyr.c @ 2167:edf8c5a70e5b

[gaim-migrate @ 2177] limiting chat message lengths committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 26 Aug 2001 20:21:45 +0000
parents a464da684307
children c24595d3c364
comparison
equal deleted inserted replaced
2166:dbd74f49dabb 2167:edf8c5a70e5b
28 #endif 28 #endif
29 29
30 #include <gtk/gtk.h> 30 #include <gtk/gtk.h>
31 #include <string.h> 31 #include <string.h>
32 #include <stdlib.h> 32 #include <stdlib.h>
33 #include <errno.h>
33 #include "gaim.h" 34 #include "gaim.h"
34 #include "prpl.h" 35 #include "prpl.h"
35 #include "zephyr/zephyr.h" 36 #include "zephyr/zephyr.h"
36 37
37 extern Code_t ZGetLocations(ZLocations_t *, int *); 38 extern Code_t ZGetLocations(ZLocations_t *, int *);
681 } 682 }
682 683
683 static void zephyr_add_buddy(struct gaim_connection *gc, char *buddy) { } 684 static void zephyr_add_buddy(struct gaim_connection *gc, char *buddy) { }
684 static void zephyr_remove_buddy(struct gaim_connection *gc, char *buddy) { } 685 static void zephyr_remove_buddy(struct gaim_connection *gc, char *buddy) { }
685 686
686 static void zephyr_chat_send(struct gaim_connection *gc, int id, char *im) 687 static int zephyr_chat_send(struct gaim_connection *gc, int id, char *im)
687 { 688 {
688 ZNotice_t notice; 689 ZNotice_t notice;
689 zephyr_triple *zt; 690 zephyr_triple *zt;
690 char *buf; 691 char *buf;
691 const char *sig; 692 const char *sig;
692 693
693 zt = find_sub_by_id(id); 694 zt = find_sub_by_id(id);
694 if (!zt) 695 if (!zt)
695 /* this should never happen. */ 696 /* this should never happen. */
696 return; 697 return -EINVAL;
697 698
698 sig = ZGetVariable("zwrite-signature"); 699 sig = ZGetVariable("zwrite-signature");
699 if (!sig) { 700 if (!sig) {
700 sig = g_get_real_name(); 701 sig = g_get_real_name();
701 } 702 }
718 "From: @bold($1) <$sender>\n\n$2"; 719 "From: @bold($1) <$sender>\n\n$2";
719 notice.z_message_len = strlen(im) + strlen(sig) + 4; 720 notice.z_message_len = strlen(im) + strlen(sig) + 4;
720 notice.z_message = buf; 721 notice.z_message = buf;
721 ZSendNotice(&notice, ZAUTH); 722 ZSendNotice(&notice, ZAUTH);
722 g_free(buf); 723 g_free(buf);
724 return 0;
723 } 725 }
724 726
725 static int zephyr_send_im(struct gaim_connection *gc, char *who, char *im, int away) { 727 static int zephyr_send_im(struct gaim_connection *gc, char *who, char *im, int away) {
726 ZNotice_t notice; 728 ZNotice_t notice;
727 char *buf; 729 char *buf;