author | Nikita Kozlov <nikita@mbdsys.com> |
Tue, 07 Dec 2010 22:57:56 +0100 | |
changeset 815 | ca323cff3ac9 |
parent 810 | 0ff0059f2ec3 |
permissions | -rw-r--r-- |
810
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
1 |
package net.java.otr4j; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
2 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
3 |
public class OtrPolicyImpl implements OtrPolicy { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
4 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
5 |
public OtrPolicyImpl() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
6 |
this.setPolicy(NEVER); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
7 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
8 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
9 |
public OtrPolicyImpl(int policy) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
10 |
this.setPolicy(policy); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
11 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
12 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
13 |
private int policy; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
14 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
15 |
public int getPolicy() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
16 |
return policy; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
17 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
18 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
19 |
private void setPolicy(int policy) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
20 |
this.policy = policy; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
21 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
22 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
23 |
public boolean getAllowV1() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
24 |
return (policy & OtrPolicy.ALLOW_V1) != 0; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
25 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
26 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
27 |
public boolean getAllowV2() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
28 |
return (policy & OtrPolicy.ALLOW_V2) != 0; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
29 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
30 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
31 |
public boolean getErrorStartAKE() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
32 |
return (policy & OtrPolicy.ERROR_START_AKE) != 0; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
33 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
34 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
35 |
public boolean getRequireEncryption() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
36 |
return getEnableManual() |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
37 |
&& (policy & OtrPolicy.REQUIRE_ENCRYPTION) != 0; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
38 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
39 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
40 |
public boolean getSendWhitespaceTag() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
41 |
return (policy & OtrPolicy.SEND_WHITESPACE_TAG) != 0; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
42 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
43 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
44 |
public boolean getWhitespaceStartAKE() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
45 |
return (policy & OtrPolicy.WHITESPACE_START_AKE) != 0; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
46 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
47 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
48 |
public void setAllowV1(boolean value) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
49 |
if (value) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
50 |
policy |= ALLOW_V1; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
51 |
else |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
52 |
policy &= ~ALLOW_V1; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
53 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
54 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
55 |
public void setAllowV2(boolean value) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
56 |
if (value) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
57 |
policy |= ALLOW_V2; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
58 |
else |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
59 |
policy &= ~ALLOW_V2; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
60 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
61 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
62 |
public void setErrorStartAKE(boolean value) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
63 |
if (value) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
64 |
policy |= ERROR_START_AKE; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
65 |
else |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
66 |
policy &= ~ERROR_START_AKE; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
67 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
68 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
69 |
public void setRequireEncryption(boolean value) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
70 |
if (value) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
71 |
policy |= REQUIRE_ENCRYPTION; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
72 |
else |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
73 |
policy &= ~REQUIRE_ENCRYPTION; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
74 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
75 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
76 |
public void setSendWhitespaceTag(boolean value) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
77 |
if (value) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
78 |
policy |= SEND_WHITESPACE_TAG; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
79 |
else |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
80 |
policy &= ~SEND_WHITESPACE_TAG; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
81 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
82 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
83 |
public void setWhitespaceStartAKE(boolean value) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
84 |
if (value) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
85 |
policy |= WHITESPACE_START_AKE; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
86 |
else |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
87 |
policy &= ~WHITESPACE_START_AKE; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
88 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
89 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
90 |
public boolean getEnableAlways() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
91 |
return getEnableManual() && getErrorStartAKE() |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
92 |
&& getSendWhitespaceTag() && getWhitespaceStartAKE(); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
93 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
94 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
95 |
public void setEnableAlways(boolean value) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
96 |
if (value) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
97 |
setEnableManual(true); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
98 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
99 |
setErrorStartAKE(value); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
100 |
setSendWhitespaceTag(value); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
101 |
setWhitespaceStartAKE(value); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
102 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
103 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
104 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
105 |
public boolean getEnableManual() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
106 |
return getAllowV1() && getAllowV2(); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
107 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
108 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
109 |
public void setEnableManual(boolean value) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
110 |
setAllowV1(value); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
111 |
setAllowV2(value); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
112 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
113 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
114 |
public boolean equals(Object obj) { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
115 |
if (obj == this) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
116 |
return true; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
117 |
if (obj == null || obj.getClass() != this.getClass()) |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
118 |
return false; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
119 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
120 |
OtrPolicy policy = (OtrPolicy) obj; |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
121 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
122 |
return policy.getPolicy() == this.getPolicy(); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
123 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
124 |
|
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
125 |
public int hashCode() { |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
126 |
return this.getPolicy(); |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
127 |
} |
0ff0059f2ec3
initial commit adding otr to beem, it's based on http://bitbucket.org/romanzadov/beem, with a better beem integration
Nikita Kozlov <nikita@mbdsys.com>
parents:
diff
changeset
|
128 |
} |