~ubuntu-branches/ubuntu/oneiric/inspircd/oneiric-security

« back to all changes in this revision

Viewing changes to src/modules/m_swhois.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2008-11-15 20:39:50 UTC
  • mfrom: (1.1.4 upstream) (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081115203950-uv1pf98x2vkon7se
Tags: 1.1.21+dfsg-1ubuntu1
* Merge from debian unstable, remaining changes: (LP: #298418)
  - debian/patches/04_include-limits-h.dpatch:
    + Explicitly include limits.h for gcc 4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
                }
57
57
                
58
58
                std::string* text;
59
 
                dest->GetExt("swhois", text);
60
 
 
61
 
                if (text)
 
59
                if (dest->GetExt("swhois", text))
62
60
                {
63
61
                        // We already had it set...
64
62
                        
117
115
                {
118
116
                        /* Insert our numeric before 312 */
119
117
                        std::string* swhois;
120
 
                        dest->GetExt("swhois", swhois);
121
 
                        if (swhois)
 
118
                        if (dest->GetExt("swhois", swhois))
122
119
                        {
123
120
                                ServerInstance->SendWhoisLine(user, dest, 320, "%s %s :%s",user->nick,dest->nick,swhois->c_str());
124
121
                        }
139
136
                {
140
137
                        // check if this user has an swhois field to send
141
138
                        std::string* swhois;
142
 
                        user->GetExt("swhois", swhois);
143
 
                        if (swhois)
 
139
                        if (user->GetExt("swhois", swhois))
144
140
                        {
145
141
                                // call this function in the linking module, let it format the data how it
146
142
                                // sees fit, and send it on its way. We dont need or want to know how.
153
149
        virtual void OnUserQuit(userrec* user, const std::string &message, const std::string &oper_message)
154
150
        {
155
151
                std::string* swhois;
156
 
                user->GetExt("swhois", swhois);
157
 
                if (swhois)
 
152
                if (user->GetExt("swhois", swhois))
158
153
                {
159
154
                        user->Shrink("swhois");
160
155
                        DELETE(swhois);
168
163
                {
169
164
                        userrec* user = (userrec*)item;
170
165
                        std::string* swhois;
171
 
                        user->GetExt("swhois", swhois);
172
 
                        if (swhois)
 
166
                        if (user->GetExt("swhois", swhois))
173
167
                        {
174
168
                                user->Shrink("swhois");
175
169
                                DELETE(swhois);