summaryrefslogtreecommitdiff
blob: 1ef6ddc5f18b6020e3e68e2aa255aeecc9ba3279 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
===================================================================
RCS file: /cvsroot/gaim-encryption/encrypt/encrypt.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- gaim-encryption/encrypt/encrypt.c	2004/06/26 01:54:36	1.112
+++ gaim-encryption/encrypt/encrypt.c	2004/07/08 03:07:01	1.113
@@ -140,8 +140,8 @@
    GaimConversation *conv;
 
    int header_size, footer_size;
-   const gchar* header = g_hash_table_lookup(header_table, (gpointer)gaim_account_get_protocol(acct));
-   const gchar* footer = g_hash_table_lookup(footer_table, (gpointer)gaim_account_get_protocol(acct));
+   const gchar* header = g_hash_table_lookup(header_table, gaim_account_get_protocol_id(acct));
+   const gchar* footer = g_hash_table_lookup(footer_table, gaim_account_get_protocol_id(acct));
 
    if (!header) header = header_default;
    if (!footer) footer = "";
@@ -201,8 +201,8 @@
    unsigned char* tmpmsg;
 
    int header_size, footer_size;
-   const gchar* header = g_hash_table_lookup(header_table, (gpointer)gaim_account_get_protocol(gc->account));
-   const gchar* footer = g_hash_table_lookup(footer_table, (gpointer)gaim_account_get_protocol(gc->account));
+   const gchar* header = g_hash_table_lookup(header_table, gaim_account_get_protocol_id(gc->account));
+   const gchar* footer = g_hash_table_lookup(footer_table, gaim_account_get_protocol_id(gc->account));
 
    if (!header) header = header_default;
    if (!footer) footer = "";
@@ -468,9 +468,9 @@
                                          /* since ICQ will now escape HTML */
 
    int header_size, footer_size;
-   const gchar* header = g_hash_table_lookup(header_table, (gpointer)gaim_account_get_protocol(acct));
-   const gchar* footer = g_hash_table_lookup(footer_table, (gpointer)gaim_account_get_protocol(acct));
-   const gchar* notify = g_hash_table_lookup(notify_table, (gpointer)gaim_account_get_protocol(acct));
+   const gchar* header = g_hash_table_lookup(header_table, gaim_account_get_protocol_id(acct));
+   const gchar* footer = g_hash_table_lookup(footer_table, gaim_account_get_protocol_id(acct));
+   const gchar* notify = g_hash_table_lookup(notify_table, gaim_account_get_protocol_id(acct));
 
    if (!header) header = header_default;
    if (!footer) footer = "";
@@ -686,9 +686,11 @@
 /* Get account-specific message size limit*/
 
 static int GE_get_msg_size_limit(GaimAccount *acct) {
-   if (gaim_account_get_protocol(acct) == GAIM_PROTO_YAHOO) {
+   const char* protocol_id = gaim_account_get_protocol_id(acct);
+
+   if (strcmp(protocol_id, "prpl-yahoo") == 0) {
       return 945;
-   } else if (gaim_account_get_protocol(acct) == GAIM_PROTO_MSN) {
+   } else if (strcmp(protocol_id, "prpl-msn") == 0) {
       return 1500; /* This may be too small... somewhere in the 1500-1600 (+ html on front/back) */
    } else {
       /* Well, ok, this isn't too exciting.  Someday we can actually check  */
@@ -713,9 +715,9 @@
    int baggage_size;
    char baggage[BUF_LONG];
 
-   const gchar* header = g_hash_table_lookup(header_table, (gpointer)gaim_account_get_protocol(acct));
-   const gchar* footer = g_hash_table_lookup(footer_table, (gpointer)gaim_account_get_protocol(acct));
-   const gchar* notify = g_hash_table_lookup(notify_table, (gpointer)gaim_account_get_protocol(acct));
+   const gchar* header = g_hash_table_lookup(header_table, gaim_account_get_protocol_id(acct));
+   const gchar* footer = g_hash_table_lookup(footer_table, gaim_account_get_protocol_id(acct));
+   const gchar* notify = g_hash_table_lookup(notify_table, gaim_account_get_protocol_id(acct));
 
    if (!header) header = header_default;
    if (!footer) footer = "";
@@ -867,8 +869,8 @@
       conv = gaim_conversation_new(GAIM_CONV_IM, acct, name);
    }
 
-   header = g_hash_table_lookup(header_table, (gpointer)gaim_account_get_protocol(conv->account));
-   footer = g_hash_table_lookup(footer_table, (gpointer)gaim_account_get_protocol(conv->account));
+   header = g_hash_table_lookup(header_table, gaim_account_get_protocol_id(conv->account));
+   footer = g_hash_table_lookup(footer_table, gaim_account_get_protocol_id(conv->account));
 
    if (!header) header = header_default;
    if (!footer) footer = "";
@@ -994,30 +996,29 @@
 }  
 
 static void GE_headers_init() {
-   header_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
-   footer_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
-   notify_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
+   header_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+   footer_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+   notify_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 
-   g_hash_table_insert(header_table, (gpointer)GAIM_PROTO_TOC,
+   g_hash_table_insert(header_table, g_strdup("prpl-toc"),
                        g_strdup("*** Encrypted with the Gaim-Encryption plugin <A HREF=\""));
-   g_hash_table_insert(footer_table, (gpointer)GAIM_PROTO_TOC,
+   g_hash_table_insert(footer_table, g_strdup("prpl-toc"),
                        g_strdup("\"></A>"));
-   g_hash_table_insert(notify_table, (gpointer)GAIM_PROTO_TOC,
+   g_hash_table_insert(notify_table, g_strdup("prpl-toc"),
                        g_strdup("<A HREF=\"Gaim-Encryption Capable\"></A>"));
 
-
-   g_hash_table_insert(header_table, (gpointer)GAIM_PROTO_OSCAR,
+   g_hash_table_insert(header_table, g_strdup("prpl-oscar"),
                        g_strdup("*** Encrypted with the Gaim-Encryption plugin <A HREF=\""));
-   g_hash_table_insert(footer_table, (gpointer)GAIM_PROTO_OSCAR,
+   g_hash_table_insert(footer_table, g_strdup("prpl-oscar"),
                        g_strdup("\"></A>"));
-   g_hash_table_insert(notify_table, (gpointer)GAIM_PROTO_OSCAR,
+   g_hash_table_insert(notify_table, g_strdup("prpl-oscar"),
                        g_strdup("<A HREF=\"Gaim-Encryption Capable\"></A>"));
 
-   g_hash_table_insert(header_table, (gpointer)GAIM_PROTO_JABBER,
+   g_hash_table_insert(header_table, g_strdup("prpl-jabber"),
                        g_strdup("*** Encrypted with the Gaim-Encryption plugin <A HREF='"));
-   g_hash_table_insert(footer_table, (gpointer)GAIM_PROTO_JABBER,
+   g_hash_table_insert(footer_table, g_strdup("prpl-jabber"),
                        g_strdup("'></A>"));
-   g_hash_table_insert(notify_table, (gpointer)GAIM_PROTO_JABBER,
+   g_hash_table_insert(notify_table, g_strdup("prpl-jabber"),
                        g_strdup("<A HREF='Gaim-Encryption Capable'> </A>"));
 
    header_default = g_strdup("*** Encrypted :");
===================================================================
RCS file: /cvsroot/gaim-encryption/encrypt/state.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- gaim-encryption/encrypt/state.c	2004/06/26 01:54:36	1.12
+++ gaim-encryption/encrypt/state.c	2004/07/08 03:07:01	1.13
@@ -143,9 +143,10 @@
    
    /* The only special case here is Oscar/TOC: If the other user's name is all */
    /* digits, then they're ICQ, so we pretend that we already notified them    */
+
+   const char* protocol_id = gaim_account_get_protocol_id(account);
    
-   if ( (gaim_account_get_protocol(account) == GAIM_PROTO_TOC) ||
-        (gaim_account_get_protocol(account) == GAIM_PROTO_OSCAR) ) {
+   if (strcmp(protocol_id, "prpl-toc") == 0 || strcmp(protocol_id, "prpl-oscar") == 0) {
       
       while(*name != 0) {
          if (!isdigit(*name++)) {