Skip to content

Commit 40cea61

Browse files
committed
Public Chats Bugs fixed
1 parent f7525eb commit 40cea61

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

__pycache__/main.cpython-38.pyc

415 Bytes
Binary file not shown.

main.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,25 @@ def Group_Exists(x):
119119
return 1
120120
return 0
121121
if Group_Exists(x):
122-
#Going To Private Chat Group
123-
import PublicChats
124-
PublicChats.main(username, x)
125-
KahesiModeOnn(username)
122+
#check Weather User Is member Or Not
123+
def mem_or_not(username):
124+
for iterate in pug_details.find():
125+
if iterate["GName"] == x:
126+
for i in iterate["Members"]["username"]:
127+
if i['username'] == username:
128+
return 1
129+
return 0
130+
return 0
131+
if mem_or_not(username):
132+
#Going To Public Chat Group
133+
import PublicChats
134+
PublicChats.main(username, x)
135+
KahesiModeOnn(username)
136+
else:
137+
print("=============================================")
138+
print("Sorry User You Need to Join This Group First")
139+
print("=============================================")
140+
PuGrp(username)
126141
else:
127142
#Redirecting Back to PuGrp function
128143
print("Sorry No Such Group Exists! But You Can Always Create One")
@@ -166,7 +181,7 @@ def KahesiModeOnn(username):
166181
print("Enter 1 to gain access to Global Chat")
167182
print("Enter 2 to gain access to LOGOUT")
168183
print("Enter 3 to go to your Public Chat Groups")
169-
print("Enter 4 to go to your Public Chat Groups")
184+
print("Enter 4 to go to your Private Chat Groups")
170185
print("Enter 5 to create New Public Group")
171186
print("Enter 6 to create New Private Group")
172187
x = int(input())
@@ -250,7 +265,10 @@ def NPuGrp(username):
250265
"username": [username]
251266
},
252267
"Members": {
253-
"username": [username]
268+
"username": [{
269+
"username": username,
270+
}
271+
]
254272
},
255273
"Chats": [
256274
{

output/main.exe

192 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)